diff --git a/.dockerignore b/.dockerignore index ce783a5054..0833b243a6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,3 +3,4 @@ .gitignore Dockerfile docker-compose.yml +_site diff --git a/Dockerfile b/Dockerfile index 8fd661bf01..23101d974e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,52 +1,45 @@ -FROM starefossen/github-pages +FROM docs/docker.github.io:docs-base -ENV VERSIONS="v1.4 v1.5 v1.6 v1.7 v1.8 v1.9 v1.10 v1.11 v1.12" +# docs-base contains: GitHub Pages, nginx, and the docs archives, running on +# Debian Jesse. See the contents of docs-base at: +# https://github.com/docker/docker.github.io/tree/docs-base -# Create archive; check out each version, create HTML, tweak links -RUN git clone https://www.github.com/docker/docker.github.io temp; \ - for VER in $VERSIONS; do \ - git --git-dir=./temp/.git --work-tree=./temp checkout ${VER} \ - && mkdir -p allvbuild/${VER} \ - && jekyll build -s temp -d allvbuild/${VER} \ - && find allvbuild/${VER} -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="/#href="/'"$VER"'/#g' \ - && find allvbuild/${VER} -type f -name '*.html' -print0 | xargs -0 sed -i 's#src="/#src="/'"$VER"'/#g' \ - && find allvbuild/${VER} -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/'"$VER"'/#g'; \ - done; \ - rm -rf temp +# Copy master into target directory (skipping files / folders in .dockerignore) +# These files represent the current docs +COPY . md_source -COPY . allv +# Move built html into md_source directory so we can reuse the target directory +# to hold the static output. +# Pull reference docs from upstream locations, then build the master docs +# into static HTML in the "target" directory using Jekyll +# then nuke the md_source directory. ## Branch to pull from, per ref doc ENV ENGINE_BRANCH="1.13.x" ENV DISTRIBUTION_BRANCH="release/2.5" -# The statements below pull reference docs from upstream locations, -# then build the whole site to static HTML using Jekyll - -RUN svn co https://github.com/docker/docker/branches/$ENGINE_BRANCH/docs/extend allv/engine/extend \ - && wget -O allv/engine/api/v1.18.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.18.md \ - && wget -O allv/engine/api/v1.19.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.19.md \ - && wget -O allv/engine/api/v1.20.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.20.md \ - && wget -O allv/engine/api/v1.21.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.21.md \ - && wget -O allv/engine/api/v1.22.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.22.md \ - && wget -O allv/engine/api/v1.23.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.23.md \ - && wget -O allv/engine/api/v1.24.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.24.md \ - && wget -O allv/engine/api/version-history.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/version-history.md \ - && wget -O allv/engine/reference/glossary.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/reference/glossary.md \ - && wget -O allv/engine/reference/builder.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/reference/builder.md \ - && wget -O allv/engine/reference/run.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/reference/run.md \ - && wget -O allv/engine/reference/commandline/cli.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/reference/commandline/cli.md \ - && wget -O allv/engine/deprecated.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/deprecated.md \ - && svn co https://github.com/docker/distribution/branches/$DISTRIBUTION_BRANCH/docs/spec allv/registry/spec \ - && rm allv/registry/spec/api.md.tmpl \ - && wget -O allv/registry/configuration.md https://raw.githubusercontent.com/docker/distribution/$DISTRIBUTION_BRANCH/docs/configuration.md \ - && rm -rf allv/apidocs/cloud-api-source \ - && rm -rf allv/tests \ - && wget -O allv/engine/api/v1.25/swagger.yaml https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/api/swagger.yaml \ - && jekyll build -s allv -d allvbuild \ - && rm -rf allvbuild/apidocs/layouts \ - && find allvbuild -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/#g' \ - && rm -rf allv - -# Serve the site, which is now all static HTML -CMD jekyll serve -s /usr/src/app/allvbuild --no-watch -H 0.0.0.0 -P 4000 +RUN svn co https://github.com/docker/docker/branches/$ENGINE_BRANCH/docs/extend md_source/engine/extend \ + && wget -O md_source/engine/api/v1.18.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.18.md \ + && wget -O md_source/engine/api/v1.19.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.19.md \ + && wget -O md_source/engine/api/v1.20.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.20.md \ + && wget -O md_source/engine/api/v1.21.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.21.md \ + && wget -O md_source/engine/api/v1.22.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.22.md \ + && wget -O md_source/engine/api/v1.23.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.23.md \ + && wget -O md_source/engine/api/v1.24.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/v1.24.md \ + && wget -O md_source/engine/api/version-history.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/api/version-history.md \ + && wget -O md_source/engine/reference/glossary.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/reference/glossary.md \ + && wget -O md_source/engine/reference/builder.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/reference/builder.md \ + && wget -O md_source/engine/reference/run.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/reference/run.md \ + && wget -O md_source/engine/reference/commandline/cli.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/reference/commandline/cli.md \ + && wget -O md_source/engine/deprecated.md https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/docs/deprecated.md \ + && svn co https://github.com/docker/distribution/branches/$DISTRIBUTION_BRANCH/docs/spec md_source/registry/spec \ + && rm md_source/registry/spec/api.md.tmpl \ + && wget -O md_source/registry/configuration.md https://raw.githubusercontent.com/docker/distribution/$DISTRIBUTION_BRANCH/docs/configuration.md \ + && rm -rf md_source/apidocs/cloud-api-source \ + && rm -rf md_source/tests \ + && wget -O md_source/engine/api/v1.25/swagger.yaml https://raw.githubusercontent.com/docker/docker/v1.13.0/api/swagger.yaml \ + && wget -O md_source/engine/api/v1.26/swagger.yaml https://raw.githubusercontent.com/docker/docker/$ENGINE_BRANCH/api/swagger.yaml \ + && jekyll build -s md_source -d target \ + && rm -rf target/apidocs/layouts \ + && find target -type f -name '*.html' -print0 | xargs -0 sed -i 's#href="https://docs.docker.com/#href="/#g' \ + && rm -rf md_source diff --git a/Gemfile b/Gemfile index 855387d549..5675358aba 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,6 @@ source "https://rubygems.org" -gem "github-pages", "105" #Update me once in a while: https://github.com/github/pages-gem/releases +# 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/ +gem "github-pages", "112" diff --git a/_config.yml b/_config.yml index ca2e5713d8..2cd7f91f78 100644 --- a/_config.yml +++ b/_config.yml @@ -11,7 +11,7 @@ permalink: pretty safe: false lsi: false url: https://docs.docker.com -keep_files: ["v1.4", "v1.5", "v1.6", "v1.7", "v1.8", "v1.9", "v1.10", "v1.11"] +keep_files: ["v1.4", "v1.5", "v1.6", "v1.7", "v1.8", "v1.9", "v1.10", "v1.11", "v1.12"] gems: - jekyll-redirect-from @@ -48,7 +48,7 @@ defaults: - scope: path: "docker-cloud" values: - assignee: "sanscontext" + assignee: "londoncalling" - scope: path: "docker-for-mac" values: @@ -60,7 +60,7 @@ defaults: - scope: path: "docker-hub" values: - assignee: "sanscontext" + assignee: "johndmulhausen" - scope: path: "docker-store" values: @@ -93,10 +93,24 @@ defaults: path: "toolbox" values: assignee: "londoncalling" + - + scope: + path: "datacenter" + values: + ucp_latest_image: "docker/ucp:2.1.0" + dtr_latest_image: "docker/dtr:2.2.0" + - + scope: + path: "datacenter/dtr/2.2" + values: + ucp_version: "2.1" + dtr_version: "2.2" + docker_image: "docker/dtr:2.2.1" - scope: path: "datacenter/dtr/2.1" values: + hide_from_sitemap: true ucp_version: "2.0" dtr_version: "2.1" - @@ -106,10 +120,18 @@ defaults: hide_from_sitemap: true ucp_version: "1.1" dtr_version: "2.0" + - + scope: + path: "datacenter/ucp/2.1" + values: + ucp_version: "2.1" + dtr_version: "2.2" + docker_image: "docker/ucp:2.1.0" - scope: path: "datacenter/ucp/2.0" values: + hide_from_sitemap: true ucp_version: "2.0" dtr_version: "2.1" - diff --git a/_data/advisories.yaml b/_data/advisories.yaml index 618cf30579..aae8d29938 100644 --- a/_data/advisories.yaml +++ b/_data/advisories.yaml @@ -15,7 +15,7 @@ texts: toolbox: "**Legacy desktop solution.** Docker Toolbox is for older Mac and Windows systems that do not meet the requirements of [Docker for Mac](/docker-for-mac/) and [Docker for Windows](/docker-for-windows/). We recommend updating to the newer applications, if possible." kitematic: "**Legacy desktop solution.** Kitematic is a legacy solution, bundled with [Docker Toolbox](/toolbox/overview/). We recommend updating to [Docker for Mac](/docker-for-mac/) or [Docker for Windows](/docker-for-windows/) if your system meets the requirements for one of those applications." swarm: "See [Swarm mode overview](/engine/swarm/) for the orchestration features introduced in Docker Engine 1.12. Only refer to the Docker Swarm documents below for information on the standalone Swarm product." - swarm-standalone: "**You are viewing docs for legacy standalone Swarm.** These topics describe standalone Docker Swarm. If you use Docker 1.12 or higher, [Swarm mode](/engine/swarm/) is integrated with Docker Engine. Most users should use integrated Swarm mode — a good place to start is [Getting started with swarm mode](/engine/swarm/swarm-tutorial/) and [Swarm mode CLI commands](/engine/swarm/index.md#swarm-mode-cli-commands). Standalone Docker Swarm is not integrated into the Docker Engine API and CLI commands." + swarm-standalone: "**You are viewing docs for legacy standalone Swarm.** These topics describe standalone Docker Swarm. In Docker 1.12 and higher, [Swarm mode](/engine/swarm/) is integrated with Docker Engine. Most users should use integrated Swarm mode — a good place to start is [Getting started with swarm mode](/engine/swarm/swarm-tutorial/), [Swarm mode CLI commands](/engine/swarm/index.md#swarm-mode-cli-commands), and the advanced [Learn Docker sample app](/engine/getstarted-voting-app/). Standalone Docker Swarm is not integrated into the Docker Engine API and CLI commands." engine: "This site contains documentation for the v1.12 release candidate version of Docker Engine. For the Docker Engine v1.11 docs, see [https://docs.docker.com/v1.11/](https://docs.docker.com/v1.11/). Docker for Mac and Docker for Windows are currently in Beta." diff --git a/_data/ddc_offline_files.yaml b/_data/ddc_offline_files.yaml index 15e08c547d..e59911416e 100644 --- a/_data/ddc_offline_files.yaml +++ b/_data/ddc_offline_files.yaml @@ -4,8 +4,18 @@ # Used by _includes/components/ddc_url_list.html +- ucp-version: "2.1" + tar-files: + - description: "UCP 2.1.0" + url: https://packages.docker.com/caas/ucp_images_2.1.0.tar.gz + - description: "DTR 2.2.1" + url: https://packages.docker.com/caas/dtr-2.2.1.tar.gz + - description: "DTR 2.2.0" + url: https://packages.docker.com/caas/dtr-2.2.0.tar.gz - ucp-version: "2.0" tar-files: + - description: "UCP 2.0.3" + url: https://packages.docker.com/caas/ucp_images_2.0.3.tar.gz - description: "UCP 2.0.2" url: https://packages.docker.com/caas/ucp_images_2.0.2.tar.gz - description: "DTR 2.1.4" diff --git a/_data/docsarchive/archive.yml b/_data/docsarchive/archive.yml deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/_data/docsarchive/v1.10/Dockerfile b/_data/docsarchive/v1.10/Dockerfile deleted file mode 100644 index 8baa1ae57d..0000000000 --- a/_data/docsarchive/v1.10/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM starefossen/ruby-node:2-5 - -RUN gem install github-pages - -WORKDIR /data - -RUN git clone https://github.com/docker/docker.github.io docs - -WORKDIR /data/docs - -RUN git checkout v1.10 - -RUN jekyll build - -ENTRYPOINT ["jekyll", "serve", "--host=0.0.0.0"] diff --git a/_data/docsarchive/v1.11/Dockerfile b/_data/docsarchive/v1.11/Dockerfile deleted file mode 100644 index 2d33963627..0000000000 --- a/_data/docsarchive/v1.11/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM starefossen/ruby-node:2-5 - -RUN gem install github-pages - -WORKDIR /data - -RUN git clone https://github.com/docker/docker.github.io docs - -WORKDIR /data/docs - -RUN git checkout v1.11 - -RUN jekyll build - -ENTRYPOINT ["jekyll", "serve", "--host=0.0.0.0"] diff --git a/_data/docsarchive/v1.4/Dockerfile b/_data/docsarchive/v1.4/Dockerfile deleted file mode 100644 index 9d03f7f85b..0000000000 --- a/_data/docsarchive/v1.4/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM starefossen/ruby-node:2-5 - -RUN gem install github-pages - -WORKDIR /data - -RUN git clone https://github.com/docker/docker.github.io docs - -WORKDIR /data/docs - -RUN git checkout v1.4 - -RUN jekyll build - -ENTRYPOINT ["jekyll", "serve", "--host=0.0.0.0"] diff --git a/_data/docsarchive/v1.5/Dockerfile b/_data/docsarchive/v1.5/Dockerfile deleted file mode 100644 index 038dd020a1..0000000000 --- a/_data/docsarchive/v1.5/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM starefossen/ruby-node:2-5 - -RUN gem install github-pages - -WORKDIR /data - -RUN git clone https://github.com/docker/docker.github.io docs - -WORKDIR /data/docs - -RUN git checkout v1.5 - -RUN jekyll build - -ENTRYPOINT ["jekyll", "serve", "--host=0.0.0.0"] diff --git a/_data/docsarchive/v1.6/Dockerfile b/_data/docsarchive/v1.6/Dockerfile deleted file mode 100644 index fe98774588..0000000000 --- a/_data/docsarchive/v1.6/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM starefossen/ruby-node:2-5 - -RUN gem install github-pages - -WORKDIR /data - -RUN git clone https://github.com/docker/docker.github.io docs - -WORKDIR /data/docs - -RUN git checkout v1.6 - -RUN jekyll build - -ENTRYPOINT ["jekyll", "serve", "--host=0.0.0.0"] diff --git a/_data/docsarchive/v1.7/Dockerfile b/_data/docsarchive/v1.7/Dockerfile deleted file mode 100644 index 74445638b1..0000000000 --- a/_data/docsarchive/v1.7/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM starefossen/ruby-node:2-5 - -RUN gem install github-pages - -WORKDIR /data - -RUN git clone https://github.com/docker/docker.github.io docs - -WORKDIR /data/docs - -RUN git checkout v1.7 - -RUN jekyll build - -ENTRYPOINT ["jekyll", "serve", "--host=0.0.0.0"] diff --git a/_data/docsarchive/v1.8/Dockerfile b/_data/docsarchive/v1.8/Dockerfile deleted file mode 100644 index 73110f4720..0000000000 --- a/_data/docsarchive/v1.8/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM starefossen/ruby-node:2-5 - -RUN gem install github-pages - -WORKDIR /data - -RUN git clone https://github.com/docker/docker.github.io docs - -WORKDIR /data/docs - -RUN git checkout v1.8 - -RUN jekyll build - -ENTRYPOINT ["jekyll", "serve", "--host=0.0.0.0"] diff --git a/_data/docsarchive/v1.9/Dockerfile b/_data/docsarchive/v1.9/Dockerfile deleted file mode 100644 index ff57967c23..0000000000 --- a/_data/docsarchive/v1.9/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM starefossen/ruby-node:2-5 - -RUN gem install github-pages - -WORKDIR /data - -RUN git clone https://github.com/docker/docker.github.io docs - -WORKDIR /data/docs - -RUN git checkout v1.9 - -RUN jekyll build - -ENTRYPOINT ["jekyll", "serve", "--host=0.0.0.0"] diff --git a/_data/docsarchive/vnext-compose/Dockerfile b/_data/docsarchive/vnext-compose/Dockerfile deleted file mode 100644 index aff08596f9..0000000000 --- a/_data/docsarchive/vnext-compose/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ - -FROM starefossen/github-pages:onbuild - -ONBUILD RUN git clone https://www.github.com/docker/docker.github.io docs - -ONBUILD WORKDIR docs - -ONBUILD RUN git checkout vnext-compose - -ONBUILD COPY . /usr/src/app - -CMD jekyll serve -d /_site -H 0.0.0.0 -P 4000 diff --git a/_data/docsarchive/vnext-distribution/Dockerfile b/_data/docsarchive/vnext-distribution/Dockerfile deleted file mode 100644 index 8461f31668..0000000000 --- a/_data/docsarchive/vnext-distribution/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ - -FROM starefossen/github-pages:onbuild - -ONBUILD RUN git clone https://www.github.com/docker/docker.github.io docs - -ONBUILD WORKDIR docs - -ONBUILD RUN git checkout vnext-distribution - -ONBUILD COPY . /usr/src/app - -CMD jekyll serve -d /_site -H 0.0.0.0 -P 4000 diff --git a/_data/docsarchive/vnext-engine/Dockerfile b/_data/docsarchive/vnext-engine/Dockerfile deleted file mode 100644 index 659b48723f..0000000000 --- a/_data/docsarchive/vnext-engine/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ - -FROM starefossen/github-pages:onbuild - -ONBUILD RUN git clone https://www.github.com/docker/docker.github.io docs - -ONBUILD WORKDIR docs - -ONBUILD RUN git checkout vnext-engine - -ONBUILD COPY . /usr/src/app - -CMD jekyll serve -d /_site -H 0.0.0.0 -P 4000 diff --git a/_data/docsarchive/vnext-kitematic/Dockerfile b/_data/docsarchive/vnext-kitematic/Dockerfile deleted file mode 100644 index 60b61b6428..0000000000 --- a/_data/docsarchive/vnext-kitematic/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ - -FROM starefossen/github-pages:onbuild - -ONBUILD RUN git clone https://www.github.com/docker/docker.github.io docs - -ONBUILD WORKDIR docs - -ONBUILD RUN git checkout vnext-kitematic - -ONBUILD COPY . /usr/src/app - -CMD jekyll serve -d /_site -H 0.0.0.0 -P 4000 diff --git a/_data/docsarchive/vnext-machine/Dockerfile b/_data/docsarchive/vnext-machine/Dockerfile deleted file mode 100644 index ffb099e5d4..0000000000 --- a/_data/docsarchive/vnext-machine/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ - -FROM starefossen/github-pages:onbuild - -ONBUILD RUN git clone https://www.github.com/docker/docker.github.io docs - -ONBUILD WORKDIR docs - -ONBUILD RUN git checkout vnext-machine - -ONBUILD COPY . /usr/src/app - -CMD jekyll serve -d /_site -H 0.0.0.0 -P 4000 diff --git a/_data/docsarchive/vnext-toolbox/Dockerfile b/_data/docsarchive/vnext-toolbox/Dockerfile deleted file mode 100644 index bda048ae6e..0000000000 --- a/_data/docsarchive/vnext-toolbox/Dockerfile +++ /dev/null @@ -1,12 +0,0 @@ - -FROM starefossen/github-pages:onbuild - -ONBUILD RUN git clone https://www.github.com/docker/docker.github.io docs - -ONBUILD WORKDIR docs - -ONBUILD RUN git checkout vnext-toolbox - -ONBUILD COPY . /usr/src/app - -CMD jekyll serve -d /_site -H 0.0.0.0 -P 4000 diff --git a/_data/engine-cli/docker.yaml b/_data/engine-cli/docker.yaml index c214f7f9ed..02b4c8fad4 100644 --- a/_data/engine-cli/docker.yaml +++ b/_data/engine-cli/docker.yaml @@ -107,3 +107,4 @@ clink: - docker_version.yaml - docker_volume.yaml - docker_wait.yaml + diff --git a/_data/engine-cli/docker_attach.yaml b/_data/engine-cli/docker_attach.yaml index 78c4f68504..bd01b497f3 100644 --- a/_data/engine-cli/docker_attach.yaml +++ b/_data/engine-cli/docker_attach.yaml @@ -1,8 +1,57 @@ command: docker attach short: Attach to a running container -long: |2 +long: |- + Use `docker attach` to attach to a running container using the container's ID + or name, either to view its ongoing output or to control it interactively. + You can attach to the same contained process multiple times simultaneously, + screen sharing style, or quickly view the progress of your detached process. - Alias for `docker container attach`. + 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. 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 @@ -15,3 +64,72 @@ options: - option: sig-proxy default_value: "true" description: Proxy all received signals to the process +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 + ``` + diff --git a/_data/engine-cli/docker_build.yaml b/_data/engine-cli/docker_build.yaml index f77ffc4304..4942d317c7 100644 --- a/_data/engine-cli/docker_build.yaml +++ b/_data/engine-cli/docker_build.yaml @@ -1,6 +1,107 @@ command: docker build short: Build an image from a Dockerfile -long: Build an image from a Dockerfile +long: |- + Builds Docker images from a Dockerfile and a "context". A build's context is + the 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 an + [*ADD*](../builder.md#add) 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 clones the + repository and its submodules using a `git clone --depth 1 --recursive` + command. This command runs in a temporary directory on your local host. After + the command succeeds, the directory is sent to the Docker daemon as the + context. Local clones give you the ability to access private repositories using + local user credentials, VPN's, and so forth. + + Git URLs accept context configuration in their fragment section, separated by a + colon `:`. The first part represents the reference that Git will check out, + this can be either a branch, a tag, or a commit SHA. 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#abcdef` | `sha1 = abcdef` | `/` + `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` + `myrepo.git#abcdef:myfolder` | `sha1 = abcdef` | `/myfolder` + + + ### Tarball contexts + + If you pass an URL to a remote tarball, the URL itself is sent to the daemon: + + 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 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 @@ -71,7 +172,8 @@ options: default_value: '[]' description: Security options - option: shm-size - description: Size of /dev/shm, default value is 64MB + default_value: "0" + description: Size of /dev/shm - option: squash default_value: "false" description: Squash newly built layers into a single new layer @@ -82,3 +184,266 @@ options: - option: ulimit default_value: '[]' description: Ulimit options +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) + + ### 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 + $ 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` will return 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` will 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#specifying-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 . + ``` + + 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. + + 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). + + ### 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"`. + + + ### Squash an image's layers (--squash) **Experimental Only** + + 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. + + **Note**: using this option means the new image will not be able to take + advantage of layer sharing with other images and may use significantly more + space. + + **Note**: 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. + diff --git a/_data/engine-cli/docker_checkpoint.yaml b/_data/engine-cli/docker_checkpoint.yaml index 29a4441af1..9dfa42eea4 100644 --- a/_data/engine-cli/docker_checkpoint.yaml +++ b/_data/engine-cli/docker_checkpoint.yaml @@ -12,3 +12,4 @@ clink: - docker_checkpoint_create.yaml - docker_checkpoint_ls.yaml - docker_checkpoint_rm.yaml + diff --git a/_data/engine-cli/docker_checkpoint_create.yaml b/_data/engine-cli/docker_checkpoint_create.yaml index 2e8f0a9529..fb9dad58c9 100644 --- a/_data/engine-cli/docker_checkpoint_create.yaml +++ b/_data/engine-cli/docker_checkpoint_create.yaml @@ -10,3 +10,4 @@ options: - option: leave-running default_value: "false" description: Leave the container running after checkpoint + diff --git a/_data/engine-cli/docker_checkpoint_ls.yaml b/_data/engine-cli/docker_checkpoint_ls.yaml index 2020317de6..aa1108e044 100644 --- a/_data/engine-cli/docker_checkpoint_ls.yaml +++ b/_data/engine-cli/docker_checkpoint_ls.yaml @@ -8,3 +8,4 @@ plink: docker_checkpoint.yaml options: - option: checkpoint-dir description: Use a custom checkpoint storage directory + diff --git a/_data/engine-cli/docker_checkpoint_rm.yaml b/_data/engine-cli/docker_checkpoint_rm.yaml index 8f140a368f..b65e833c63 100644 --- a/_data/engine-cli/docker_checkpoint_rm.yaml +++ b/_data/engine-cli/docker_checkpoint_rm.yaml @@ -8,3 +8,4 @@ plink: docker_checkpoint.yaml options: - option: checkpoint-dir description: Use a custom checkpoint storage directory + diff --git a/_data/engine-cli/docker_commit.yaml b/_data/engine-cli/docker_commit.yaml index e7d1fe7a60..ff6c8416c3 100644 --- a/_data/engine-cli/docker_commit.yaml +++ b/_data/engine-cli/docker_commit.yaml @@ -1,7 +1,23 @@ command: docker commit short: Create a new image from a container's changes -long: | - Alias for `docker container commit`. +long: |- + It can be useful to commit a container's file changes or settings into a new + image. This allows you 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 @@ -20,3 +36,72 @@ options: shorthand: p default_value: "true" description: Pause container during commit +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 + {% raw %} + $ docker ps + + ICONTAINER 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] + {% endraw %} + ``` + + ### 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 + ``` + diff --git a/_data/engine-cli/docker_container.yaml b/_data/engine-cli/docker_container.yaml index 82d287f858..1b4eb1313f 100644 --- a/_data/engine-cli/docker_container.yaml +++ b/_data/engine-cli/docker_container.yaml @@ -56,3 +56,4 @@ clink: - docker_container_unpause.yaml - docker_container_update.yaml - docker_container_wait.yaml + diff --git a/_data/engine-cli/docker_container_attach.yaml b/_data/engine-cli/docker_container_attach.yaml index a4aae7f068..dc7b6dc811 100644 --- a/_data/engine-cli/docker_container_attach.yaml +++ b/_data/engine-cli/docker_container_attach.yaml @@ -1,72 +1,6 @@ command: docker container attach short: Attach to a running container -long: | - The **docker attach** command allows you to attach to a running container using - the container's ID or name, either to view its ongoing output or to control it - interactively. You can attach to the same contained process multiple times - simultaneously, screen sharing style, or quickly view the progress of your - detached process. - - To stop a container, use `CTRL-c`. This key sequence sends `SIGKILL` to the - container. You can detach from the container (and leave it running) using a - configurable key sequence. The default sequence is `CTRL-p CTRL-q`. You - configure the key sequence using the **--detach-keys** option or a configuration - file. See **config-json(5)** for documentation on using a configuration file. - - 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`). - - # 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 **docker(1)**. - - # EXAMPLES - - ## Attaching to a container - - In this example the top command is run inside a container, from an image called - fedora, in detached mode. The ID from the container is passed into the **docker - attach** command: - - # ID=$(sudo docker run -d fedora /usr/bin/top -b) - # sudo docker attach $ID - 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%!u(MISSING)s, 0.2%!s(MISSING)y, 0.0%!n(MISSING)i, 99.7%!i(MISSING)d, 0.0%!w(MISSING)a, 0.0%!h(MISSING)i, 0.0%!s(MISSING)i, 0.0%!s(MISSING)t - 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 %!C(MISSING)PU %!M(MISSING)EM 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%!u(MISSING)s, 0.2%!s(MISSING)y, 0.0%!n(MISSING)i, 99.8%!i(MISSING)d, 0.0%!w(MISSING)a, 0.0%!h(MISSING)i, 0.0%!s(MISSING)i, 0.0%!s(MISSING)t - 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 %!C(MISSING)PU %!M(MISSING)EM TIME+ COMMAND - 1 root 20 0 17208 1144 932 R 0 0.3 0:00.03 top +long: Attach to a running container usage: docker container attach [OPTIONS] CONTAINER pname: docker container plink: docker_container.yaml @@ -79,3 +13,4 @@ options: - option: sig-proxy default_value: "true" description: Proxy all received signals to the process + diff --git a/_data/engine-cli/docker_container_commit.yaml b/_data/engine-cli/docker_container_commit.yaml index 412db626cd..02372e375e 100644 --- a/_data/engine-cli/docker_container_commit.yaml +++ b/_data/engine-cli/docker_container_commit.yaml @@ -1,22 +1,6 @@ command: docker container commit short: Create a new image from a container's changes -long: "Create a new image from an existing container specified by name or\ncontainer - ID. The new image will contain the contents of the\ncontainer filesystem, *excluding* - any data volumes. Refer to **docker-tag(1)**\nfor more information about valid image - and tag names.\n\nWhile the `docker commit` command is a convenient way of extending - an\nexisting image, you should prefer the use of a Dockerfile and `docker\nbuild` - for generating images that you intend to share with other\npeople.\n\n# EXAMPLES\n\n## - Creating a new image from an existing container\nAn existing Fedora based container - has had Apache installed while running\nin interactive mode with the bash shell. - Apache is also running. To\ncreate a new image run `docker ps` to find the container's - ID and then run:\n\n # docker commit -m=\"Added Apache to Fedora base image\" - \\\n -a=\"A D Ministrator\" 98bd7fc99854 fedora/fedora_httpd:20\n\nNote that - only a-z0-9-_. are allowed when naming images from an \nexisting container.\n\n## - Apply specified Dockerfile instructions while committing the image\nIf an existing - container was created without the DEBUG environment\nvariable set to \"true\", you - can create a new image based on that\ncontainer by first getting the container's - ID with `docker ps` and\nthen running:\n\n # docker container commit -c=\"ENV - DEBUG true\" 98bd7fc99854 debug-image\n" +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 @@ -35,3 +19,4 @@ options: shorthand: p default_value: "true" description: Pause container during commit + diff --git a/_data/engine-cli/docker_container_cp.yaml b/_data/engine-cli/docker_container_cp.yaml index 8004ebace4..fd52ea518b 100644 --- a/_data/engine-cli/docker_container_cp.yaml +++ b/_data/engine-cli/docker_container_cp.yaml @@ -1,94 +1,12 @@ command: docker container cp short: Copy files/folders between a container and the local filesystem -long: "The `docker container cp` utility copies the contents of `SRC_PATH` to the - `DEST_PATH`.\nYou can copy from the container's file system to the local machine - or the\nreverse, from the local filesystem to the container. If `-` is specified - for\neither the `SRC_PATH` or `DEST_PATH`, you can also stream a tar archive from\n`STDIN` - or to `STDOUT`. The `CONTAINER` can be a running or stopped container.\nThe `SRC_PATH` - or `DEST_PATH` can be a file or directory.\n\nThe `docker container cp` command - assumes container paths are relative to the container's \n`/` (root) directory. - This means supplying the initial forward slash is optional; \nThe command sees `compassionate_darwin:/tmp/foo/myfile.txt` - and\n`compassionate_darwin:tmp/foo/myfile.txt` as identical. Local machine paths - can\nbe an absolute or relative value. The command interprets a local machine's\nrelative - paths as relative to the current working directory where `docker container cp` is\nrun.\n\nThe - `cp` command behaves like the Unix `cp -a` command in that directories are\ncopied - recursively with permissions preserved if possible. Ownership is set to\nthe user - and primary group at the destination. For example, files copied to a\ncontainer - are created with `UID:GID` of the root user. Files copied to the local\nmachine - are created with the `UID:GID` of the user which invoked the `docker container cp`\ncommand. - \ If you specify the `-L` option, `docker container cp` follows any symbolic link\nin - the `SRC_PATH`. `docker container cp` does *not* create parent directories for\n`DEST_PATH` - if they do not exist.\n\nAssuming a path separator of `/`, a first argument of `SRC_PATH` - and second\nargument of `DEST_PATH`, the behavior is as follows:\n\n- `SRC_PATH` - specifies a file\n - `DEST_PATH` does not exist\n - the file is saved - to a file created at `DEST_PATH`\n - `DEST_PATH` does not exist and ends with - `/`\n - Error condition: the destination directory must exist.\n - `DEST_PATH` - exists and is a file\n - the destination is overwritten with the source file's - contents\n - `DEST_PATH` exists and is a directory\n - the file is copied - into this directory using the basename from\n `SRC_PATH`\n- `SRC_PATH` - specifies a directory\n - `DEST_PATH` does not exist\n - `DEST_PATH` is - created as a directory and the *contents* of the source\n directory are - copied into this directory\n - `DEST_PATH` exists and is a file\n - Error - condition: cannot copy a directory to a file\n - `DEST_PATH` exists and is a - directory\n - `SRC_PATH` does not end with `/.` (that is: _slash_ followed - by _dot_)\n - the source directory is copied into this directory\n - - `SRC_PATH` does end with `/.` (that is: _slash_ followed by _dot_)\n - - the *content* of the source directory is copied into this\n directory\n\nThe - command requires `SRC_PATH` and `DEST_PATH` to exist according to the above\nrules. - If `SRC_PATH` is local and is a symbolic link, the symbolic link, not\nthe target, - is copied by default. To copy the link target and not the link, \nspecify the `-L` - option.\n\nA colon (`:`) is used as a delimiter between `CONTAINER` and its path. - You can\nalso use `:` when specifying paths to a `SRC_PATH` or `DEST_PATH` on a - local\nmachine, for example `file:name.txt`. If you use a `:` in a local machine - path,\nyou must be explicit with a relative or absolute path, for example:\n\n `/path/to/file:name.txt` - or `./file:name.txt`\n\nIt is not possible to copy certain system files such as - resources under\n`/proc`, `/sys`, `/dev`, tmpfs, and mounts created by the user - in the container.\nHowever, you can still copy such files by manually running `tar` - in `docker exec`.\nFor example (consider `SRC_PATH` and `DEST_PATH` are directories):\n\n - \ $ docker exec foo tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | tar Cxf - DEST_PATH -\n\nor\n\n $ tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | - docker exec -i foo tar Cxf DEST_PATH -\n\n\nUsing `-` as the `SRC_PATH` streams - the contents of `STDIN` as a tar archive.\nThe command extracts the content of the - tar to the `DEST_PATH` in container's\nfilesystem. In this case, `DEST_PATH` must - specify a directory. Using `-` as\nthe `DEST_PATH` streams the contents of the resource - as a tar archive to `STDOUT`.\n\n# EXAMPLES\n\nSuppose a container has finished - producing some output as a file it saves\nto somewhere in its filesystem. This could - be the output of a build job or\nsome other computation. You can copy these outputs - from the container to a\nlocation on your local host.\n\nIf you want to copy the - `/tmp/foo` directory from a container to the\nexisting `/tmp` directory on your - host. If you run `docker container cp` in your `~`\n(home) directory on the local - host:\n\n $ docker container cp compassionate_darwin:tmp/foo /tmp\n\nDocker creates - a `/tmp/foo` directory on your host. Alternatively, you can omit\nthe leading slash - in the command. If you execute this command from your home\ndirectory:\n\n $ - docker container cp compassionate_darwin:tmp/foo tmp\n\nIf `~/tmp` does not exist, - Docker will create it and copy the contents of\n`/tmp/foo` from the container into - this new directory. If `~/tmp` already\nexists as a directory, then Docker will - copy the contents of `/tmp/foo` from\nthe container into a directory at `~/tmp/foo`.\n\nWhen - copying a single file to an existing `LOCALPATH`, the `docker container cp` command\nwill - either overwrite the contents of `LOCALPATH` if it is a file or place it\ninto `LOCALPATH` - if it is a directory, overwriting an existing file of the same\nname if one exists. - For example, this command:\n\n $ docker container cp sharp_ptolemy:/tmp/foo/myfile.txt - /test\n\nIf `/test` does not exist on the local machine, it will be created as a - file\nwith the contents of `/tmp/foo/myfile.txt` from the container. If `/test`\nexists - as a file, it will be overwritten. Lastly, if `/test` exists as a\ndirectory, the - file will be copied to `/test/myfile.txt`.\n\nNext, suppose you want to copy a file - or folder into a container. For example,\nthis could be a configuration file or - some other input to a long running\ncomputation that you would like to place into - a created container before it\nstarts. This is useful because it does not require - the configuration file or\nother input to exist in the container image.\n\nIf you - have a file, `config.yml`, in the current directory on your local host\nand wish - to copy it to an existing directory at `/etc/my-app.d` in a container,\nthis command - can be used:\n\n $ docker container cp config.yml myappcontainer:/etc/my-app.d\n\nIf - you have several files in a local directory `/config` which you need to copy\nto - a directory `/etc/my-app.d` in a container:\n\n $ docker container cp /config/. - myappcontainer:/etc/my-app.d\n\nThe above command will copy the contents of the - local `/config` directory into\nthe directory `/etc/my-app.d` in the container.\n\nFinally, - if you want to copy a symbolic link into a container, you typically\nwant to copy - the linked target and not the link itself. To copy the target, use\nthe `-L` option, - for example:\n\n $ ln -s /tmp/somefile /tmp/somefile.ln\n $ docker container - cp -L /tmp/somefile.ln myappcontainer:/tmp/\n\nThis command copies content of the - local `/tmp/somefile` into the file\n`/tmp/somefile.ln` in the container. Without - `-L` option, the `/tmp/somefile.ln`\npreserves its symbolic link but not its content.\n" +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 @@ -98,3 +16,4 @@ options: shorthand: L default_value: "false" description: Always follow symbol link in SRC_PATH + diff --git a/_data/engine-cli/docker_container_create.yaml b/_data/engine-cli/docker_container_create.yaml index 31163b96ed..f8c4f4d223 100644 --- a/_data/engine-cli/docker_container_create.yaml +++ b/_data/engine-cli/docker_container_create.yaml @@ -1,73 +1,6 @@ command: docker container create short: Create a new container -long: "Creates a writeable container layer over the specified image and prepares it - for\nrunning the specified command. The container ID is then printed to STDOUT. - This\nis similar to **docker run -d** except the container is never started. You - can \nthen use the **docker start ** command to start the container - at\nany point.\n\nThe initial status of the container created with **docker create** - is 'created'.\n\n# OPTIONS \n\nThe `CONTAINER-DIR` must be an absolute path such - as `/src/docs`. The `HOST-DIR`\ncan be an absolute path or a `name` value. A `name` - value must start with an\nalphanumeric character, followed by `a-z0-9`, `_` (underscore), - `.` (period) or\n`-` (hyphen). An absolute path starts with a `/` (forward slash).\n\nIf - you supply a `HOST-DIR` that is an absolute path, Docker bind-mounts to the\npath - you specify. If you supply a `name`, Docker creates a named volume by that\n`name`. - For example, you can specify either `/foo` or `foo` for a `HOST-DIR`\nvalue. If - you supply the `/foo` value, Docker creates a bind-mount. If you\nsupply the `foo` - specification, Docker creates a named volume.\n\nYou can specify multiple **-v** - options to mount one or more mounts to a\ncontainer. To use these same mounts in - other containers, specify the\n**--volumes-from** option also.\n\nYou can add `:ro` - or `:rw` suffix to a volume to mount it read-only or\nread-write mode, respectively. - By default, the volumes are mounted read-write.\nSee examples.\n\nLabeling systems - like SELinux require that proper labels are placed on volume\ncontent mounted into - a container. Without a label, the security system might\nprevent the processes running - inside the container from using the content. By\ndefault, Docker does not change - the labels set by the OS.\n\nTo change a label in the container context, you can - add either of two suffixes\n`:z` or `:Z` to the volume mount. These suffixes tell - Docker to relabel file\nobjects on the shared volumes. The `z` option tells Docker - that two containers\nshare the volume content. As a result, Docker labels the content - with a shared\ncontent label. Shared volume labels allow all containers to read/write - content.\nThe `Z` option tells Docker to label the content with a private unshared - label.\nOnly the current container can use a private volume.\n\nBy default bind - mounted volumes are `private`. That means any mounts done\ninside container will - not be visible on host and vice-a-versa. One can change\nthis behavior by specifying - a volume mount propagation property. Making a\nvolume `shared` mounts done under - that volume inside container will be\nvisible on host and vice-a-versa. Making a - volume `slave` enables only one\nway mount propagation and that is mounts done on - host under that volume\nwill be visible inside container but not the other way around.\n\nTo - control mount propagation property of volume one can use `:[r]shared`,\n`:[r]slave` - or `:[r]private` propagation flag. Propagation property can\nbe specified only for - bind mounted volumes and not for internal volumes or\nnamed volumes. For mount propagation - to work source mount point (mount point\nwhere source dir is mounted on) has to - have right propagation properties. For\nshared volumes, source mount point has to - be shared. And for slave volumes,\nsource mount has to be either shared or slave.\n\nUse - `df ` to figure out the source mount and then use\n`findmnt -o TARGET,PROPAGATION - ` to figure out propagation\nproperties of source mount. If `findmnt` - utility is not available, then one\ncan look at mount entry for source mount point - in `/proc/self/mountinfo`. Look\nat `optional fields` and see if any propagaion - properties are specified.\n`shared:X` means mount is `shared`, `master:X` means - mount is `slave` and if\nnothing is there that means mount is `private`.\n\nTo change - propagation properties of a mount point use `mount` command. For\nexample, if one - wants to bind mount source directory `/foo` one can do\n`mount --bind /foo /foo` - and `mount --make-private --make-shared /foo`. This\nwill convert /foo into a `shared` - mount point. Alternatively one can directly\nchange propagation properties of source - mount. Say `/` is source mount for\n`/foo`, then use `mount --make-shared /` to - convert `/` into a `shared` mount.\n\n> **Note**:\n> When using systemd to manage - the Docker daemon's start and stop, in the systemd\n> unit file there is an option - to control mount propagation for the Docker daemon\n> itself, called `MountFlags`. - The value of this setting may cause Docker to not\n> see mount propagation changes - made on the mount point. For example, if this value\n> is `slave`, you may not be - able to use the `shared` or `rshared` propagation on\n> a volume.\n\n\nTo disable - automatic copying of data from the container path to the volume, use\nthe `nocopy` - flag. The `nocopy` flag can be set on bind mounts and named volumes.\n\n# EXAMPLES\n\n## - Specify isolation technology for container (--isolation)\n\nThis option is useful - in situations where you are running Docker containers on\nWindows. The `--isolation=` - option sets a container's isolation\ntechnology. On Linux, the only supported is - the `default` option which uses\nLinux namespaces. On Microsoft Windows, you can - specify these values:\n\n* `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.\n* `process`: Namespace isolation only.\n* - `hyperv`: Hyper-V hypervisor partition-based isolation.\n\nSpecifying the `--isolation` - flag without a value is the same as setting `--isolation=\"default\"`.\n" +long: Create a new container usage: docker container create [OPTIONS] IMAGE [COMMAND] [ARG...] pname: docker container plink: docker_container.yaml @@ -130,6 +63,9 @@ options: - option: device default_value: '[]' description: Add a host device to the container +- option: device-cgroup-rule + default_value: '[]' + description: Add a rule to the cgroup allowed devices list - option: device-read-bps default_value: '[]' description: Limit read rate (bytes per second) from a device @@ -175,13 +111,13 @@ options: - option: health-cmd description: Command to run to check health - option: health-interval - default_value: "0" + default_value: 0s description: Time between running the check (ns|us|ms|s|m|h) (default 0s) - option: health-retries default_value: "0" description: Consecutive failures needed to report unhealthy - option: health-timeout - default_value: "0" + default_value: 0s description: | Maximum time to allow one check to run (ns|us|ms|s|m|h) (default 0s) - option: help @@ -301,7 +237,8 @@ options: default_value: '[]' description: Security Options - option: shm-size - description: Size of /dev/shm, default value is 64MB + default_value: "0" + description: Size of /dev/shm - option: stop-signal default_value: SIGTERM description: Signal to stop a container, SIGTERM by default @@ -343,3 +280,4 @@ options: - option: workdir shorthand: w description: Working directory inside the container + diff --git a/_data/engine-cli/docker_container_diff.yaml b/_data/engine-cli/docker_container_diff.yaml index c344f75d49..425e2321ef 100644 --- a/_data/engine-cli/docker_container_diff.yaml +++ b/_data/engine-cli/docker_container_diff.yaml @@ -1,45 +1,7 @@ command: docker container 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. - - # 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 - ``` +long: Inspect changes to files or directories on a container's filesystem usage: docker container diff CONTAINER pname: docker container plink: docker_container.yaml + diff --git a/_data/engine-cli/docker_container_exec.yaml b/_data/engine-cli/docker_container_exec.yaml index c7fa774a2b..c7f9156ae0 100644 --- a/_data/engine-cli/docker_container_exec.yaml +++ b/_data/engine-cli/docker_container_exec.yaml @@ -1,18 +1,6 @@ command: docker container exec short: Run a command in a running container -long: "Run a process in a running container.\n\nThe command started using `docker - exec` will only run while the container's primary\nprocess (`PID 1`) is running, - and will not be restarted if the container is restarted.\n\nIf the container is - paused, then the `docker exec` command will wait until the\ncontainer is unpaused, - and then run\n\n# CAPABILITIES\n\n`privileged` gives the process extended\n[Linux - capabilities](http://man7.org/linux/man-pages/man7/capabilities.7.html)\nwhen running - in a container. \n\nWithout this flag, the process run by `docker exec` in a running - container has\nthe same capabilities as the container, which may be limited. Set\n`--privileged` - to give all capabilities to the process.\n\n# USER\n`user` sets the username or - UID used and optionally the groupname or GID for the specified command.\n\n The - followings examples are all valid:\n --user [user | user:group | uid | uid:gid - | user:gid | uid:group ]\n\n Without this argument the command will be run as - root in the container.\n" +long: Run a command in a running container usage: docker container exec [OPTIONS] CONTAINER COMMAND [ARG...] pname: docker container plink: docker_container.yaml @@ -41,3 +29,4 @@ options: - option: user shorthand: u description: 'Username or UID (format: [:])' + diff --git a/_data/engine-cli/docker_container_export.yaml b/_data/engine-cli/docker_container_export.yaml index 5de3268494..64ed34da1a 100644 --- a/_data/engine-cli/docker_container_export.yaml +++ b/_data/engine-cli/docker_container_export.yaml @@ -1,26 +1,6 @@ command: docker container export short: Export a container's filesystem as a tar archive -long: | - Export the contents of a container's filesystem using the full or shortened - container ID or container name. The output is exported to STDOUT and can be - redirected to a tar file. - - Stream to a file instead of STDOUT by using **-o**. - - # EXAMPLES - Export the contents of the container called angry_bell to a tar file - called angry_bell.tar: - - # docker export angry_bell > angry_bell.tar - # docker export --output=angry_bell-latest.tar angry_bell - # ls -sh angry_bell.tar - 321M angry_bell.tar - # ls -sh angry_bell-latest.tar - 321M angry_bell-latest.tar - - # See also - **docker-import(1)** to create an empty filesystem image - and import the contents of the tarball into it, then optionally tag it. +long: Export a container's filesystem as a tar archive usage: docker container export [OPTIONS] CONTAINER pname: docker container plink: docker_container.yaml @@ -28,3 +8,4 @@ options: - option: output shorthand: o description: Write to a file, instead of STDOUT + diff --git a/_data/engine-cli/docker_container_inspect.yaml b/_data/engine-cli/docker_container_inspect.yaml index 6590496cbd..5a90b6ee5b 100644 --- a/_data/engine-cli/docker_container_inspect.yaml +++ b/_data/engine-cli/docker_container_inspect.yaml @@ -12,3 +12,4 @@ options: shorthand: s default_value: "false" description: Display total file sizes + diff --git a/_data/engine-cli/docker_container_kill.yaml b/_data/engine-cli/docker_container_kill.yaml index 95801192de..01d3d699fb 100644 --- a/_data/engine-cli/docker_container_kill.yaml +++ b/_data/engine-cli/docker_container_kill.yaml @@ -1,8 +1,6 @@ command: docker container kill short: Kill one or more running containers -long: | - The main process inside each container specified will be sent SIGKILL, - or any signal specified with option --signal. +long: Kill one or more running containers usage: docker container kill [OPTIONS] CONTAINER [CONTAINER...] pname: docker container plink: docker_container.yaml @@ -11,3 +9,4 @@ options: shorthand: s default_value: KILL description: Signal to send to the container + diff --git a/_data/engine-cli/docker_container_logs.yaml b/_data/engine-cli/docker_container_logs.yaml index 6b4262cfc3..456295e7c6 100644 --- a/_data/engine-cli/docker_container_logs.yaml +++ b/_data/engine-cli/docker_container_logs.yaml @@ -1,34 +1,6 @@ command: docker container logs short: Fetch the logs of a container -long: | - The **docker container logs** command batch-retrieves whatever logs are present for - a container at the time of execution. This does not guarantee execution - order when combined with a docker run (i.e., your run may not have generated - any logs at the time you execute docker container logs). - - The **docker container logs --follow** command combines commands **docker container logs** and - **docker attach**. It will first return all logs from the beginning and - then continue streaming new output from the container's stdout and stderr. - - **Warning**: This command works only for the **json-file** or **journald** - logging drivers. - - The `--since` option can be Unix timestamps, date formatted timestamps, or Go - duration strings (e.g. `10m`, `1h30m`) computed relative to the client 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 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. - - The `docker container logs --details` command will add on extra attributes, such as - environment variables and labels, provided to `--log-opt` when creating the - container. +long: Fetch the logs of a container usage: docker container logs [OPTIONS] CONTAINER pname: docker container plink: docker_container.yaml @@ -50,3 +22,4 @@ options: shorthand: t default_value: "false" description: Show timestamps + diff --git a/_data/engine-cli/docker_container_ls.yaml b/_data/engine-cli/docker_container_ls.yaml index 81a7fe422a..02afb6b983 100644 --- a/_data/engine-cli/docker_container_ls.yaml +++ b/_data/engine-cli/docker_container_ls.yaml @@ -1,103 +1,7 @@ command: docker container ls aliases: ps, list short: List containers -long: | - List the containers in the local repository. By default this shows only - the running containers. - - ## Filters - - Filter output based on these conditions: - - exited= an exit code of - - label= or label== - - status=(created|restarting|running|paused|exited|dead) - - name= a container's name - - id= a container's ID - - is-task=(true|false) - containers that are a task (part of a service managed by swarm) - - before=(|) - - since=(|) - - ancestor=([:tag]||) - containers created from an image or a descendant. - - volume=(|) - - network=(|) - containers connected to the provided network - - health=(starting|healthy|unhealthy|none) - filters containers based on healthcheck status - - ## Format - - Pretty-print containers using a Go template. - Valid placeholders: - .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. - - # EXAMPLES - # Display all containers, including non-running - - # docker container ls -a - CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES - a87ecb4f327c fedora:20 /bin/sh -c #(nop) MA 20 minutes ago Exit 0 desperate_brattain - 01946d9d34d8 vpavlin/rhel7:latest /bin/sh -c #(nop) MA 33 minutes ago Exit 0 thirsty_bell - c1d3b0166030 acffc0358b9e /bin/sh -c yum -y up 2 weeks ago Exit 1 determined_torvalds - 41d50ecd2f57 fedora:20 /bin/sh -c #(nop) MA 2 weeks ago Exit 0 drunk_pike - - # Display only IDs of all containers, including non-running - - # docker container ls -a -q - a87ecb4f327c - 01946d9d34d8 - c1d3b0166030 - 41d50ecd2f57 - - # Display only IDs of all containers that have the name `determined_torvalds` - - # docker container ls -a -q --filter=name=determined_torvalds - c1d3b0166030 - - # Display containers with their commands - - # docker container ls --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 - - # Display containers with their labels in a table - - # docker container ls --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 - - # Display containers with their node label in a table - - # docker container ls --format 'table {{.ID}}\t{{(.Label "com.docker.swarm.node")}}' - CONTAINER ID NODE - a87ecb4f327c ubuntu - 01946d9d34d8 - c1d3b0166030 debian - 41d50ecd2f57 fedora - - # Display containers with `remote-volume` mounted - - $ docker container ls --filter volume=remote-volume --format "table {{.ID}}\t{{.Mounts}}" - CONTAINER ID MOUNTS - 9c3527ed70ce remote-volume - - # Display containers with a volume mounted in `/data` - - $ docker container ls --filter volume=/data --format "table {{.ID}}\t{{.Mounts}}" - CONTAINER ID MOUNTS - 9c3527ed70ce remote-volume +long: List containers usage: docker container ls [OPTIONS] pname: docker container plink: docker_container.yaml @@ -130,3 +34,4 @@ options: shorthand: s default_value: "false" description: Display total file sizes + diff --git a/_data/engine-cli/docker_container_pause.yaml b/_data/engine-cli/docker_container_pause.yaml index aa7ad63823..731aa812eb 100644 --- a/_data/engine-cli/docker_container_pause.yaml +++ b/_data/engine-cli/docker_container_pause.yaml @@ -1,18 +1,7 @@ command: docker container pause short: Pause all processes within one or more containers -long: | - The `docker container pause` command suspends all processes in the specified containers. - On Linux, this uses the cgroups freezer. Traditionally, when suspending a process - the `SIGSTOP` signal is used, which is observable by the process being suspended. - With the cgroups freezer 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 [cgroups freezer documentation] - (https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) for - further details. - - **docker-container-unpause(1)** to unpause all processes within a container. +long: Pause all processes within one or more containers usage: docker container pause CONTAINER [CONTAINER...] pname: docker container plink: docker_container.yaml + diff --git a/_data/engine-cli/docker_container_port.yaml b/_data/engine-cli/docker_container_port.yaml index 9b03d016b3..fa70cdd164 100644 --- a/_data/engine-cli/docker_container_port.yaml +++ b/_data/engine-cli/docker_container_port.yaml @@ -1,32 +1,7 @@ command: docker container port short: List port mappings or a specific mapping for the container -long: | - List port mappings for the CONTAINER, or lookup the public-facing port that is NAT-ed to the PRIVATE_PORT - - # EXAMPLES - - # 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 - - ## Find out all the ports mapped - - # docker container port test - 7890/tcp -> 0.0.0.0:4321 - 9876/tcp -> 0.0.0.0:1234 - - ## Find out a specific mapping - - # docker container port test 7890/tcp - 0.0.0.0:4321 - - # docker container port test 7890 - 0.0.0.0:4321 - - ## An example showing error for non-existent mapping - - # docker container port test 7890/udp - 2014/06/24 11:53:36 Error: No public port '7890/udp' published for test +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 + diff --git a/_data/engine-cli/docker_container_prune.yaml b/_data/engine-cli/docker_container_prune.yaml index 91f6f3501b..88724bdee5 100644 --- a/_data/engine-cli/docker_container_prune.yaml +++ b/_data/engine-cli/docker_container_prune.yaml @@ -11,3 +11,4 @@ options: shorthand: f default_value: "false" description: Do not prompt for confirmation + diff --git a/_data/engine-cli/docker_container_rename.yaml b/_data/engine-cli/docker_container_rename.yaml index 6c19dce044..44d38a7ef3 100644 --- a/_data/engine-cli/docker_container_rename.yaml +++ b/_data/engine-cli/docker_container_rename.yaml @@ -1,7 +1,7 @@ command: docker container rename short: Rename a container -long: | - Rename a container. Container may be running, paused or stopped. +long: Rename a container usage: docker container rename CONTAINER NEW_NAME pname: docker container plink: docker_container.yaml + diff --git a/_data/engine-cli/docker_container_restart.yaml b/_data/engine-cli/docker_container_restart.yaml index 0e0003ec18..c6113f330a 100644 --- a/_data/engine-cli/docker_container_restart.yaml +++ b/_data/engine-cli/docker_container_restart.yaml @@ -1,7 +1,6 @@ command: docker container restart short: Restart one or more containers -long: | - Restart each container listed. +long: Restart one or more containers usage: docker container restart [OPTIONS] CONTAINER [CONTAINER...] pname: docker container plink: docker_container.yaml @@ -10,3 +9,4 @@ options: shorthand: t default_value: "10" description: Seconds to wait for stop before killing the container + diff --git a/_data/engine-cli/docker_container_rm.yaml b/_data/engine-cli/docker_container_rm.yaml index 45b4566323..153455c4de 100644 --- a/_data/engine-cli/docker_container_rm.yaml +++ b/_data/engine-cli/docker_container_rm.yaml @@ -1,43 +1,6 @@ command: docker container rm short: Remove one or more containers -long: | - **docker container rm** will remove one or more containers from the host node. The - container name or ID can be used. This does not remove images. You cannot - remove a running container unless you use the **-f** option. To see all - containers on a host use the **docker container ls -a** command. - - # EXAMPLES - - ## Removing a container using its ID - - To remove a container using its ID, find either from a **docker ps -a** - command, or use the ID returned from the **docker run** command, or retrieve - it from a file used to store it using the **docker run --cidfile**: - - docker container rm abebf7571666 - - ## Removing a container using the container name - - The name of the container can be found using the **docker ps -a** - command. The use that name as follows: - - docker container rm hopeful_morse - - ## Removing a container and all associated volumes - - $ docker container rm -v redis - redis - - This command will remove the container and any volumes associated with it. - Note that if a volume was specified with a name, it will not be removed. - - $ docker create -v awesome:/foo -v /bar --name hello redis - hello - $ docker container rm -v hello - - In this example, the volume for `/foo` will remain in tact, but the volume for - `/bar` will be removed. The same behavior holds for volumes inherited with - `--volumes-from`. +long: Remove one or more containers usage: docker container rm [OPTIONS] CONTAINER [CONTAINER...] pname: docker container plink: docker_container.yaml @@ -54,3 +17,4 @@ options: shorthand: v default_value: "false" description: Remove the volumes associated with the container + diff --git a/_data/engine-cli/docker_container_run.yaml b/_data/engine-cli/docker_container_run.yaml index 5b73128421..c333a74270 100644 --- a/_data/engine-cli/docker_container_run.yaml +++ b/_data/engine-cli/docker_container_run.yaml @@ -1,7 +1,6 @@ command: docker container run short: Run a command in a new container -long: | - Alias for `docker run`. +long: Run a command in a new container usage: docker container run [OPTIONS] IMAGE [COMMAND] [ARG...] pname: docker container plink: docker_container.yaml @@ -70,6 +69,9 @@ options: - option: device default_value: '[]' description: Add a host device to the container +- option: device-cgroup-rule + default_value: '[]' + description: Add a rule to the cgroup allowed devices list - option: device-read-bps default_value: '[]' description: Limit read rate (bytes per second) from a device @@ -115,13 +117,13 @@ options: - option: health-cmd description: Command to run to check health - option: health-interval - default_value: "0" + default_value: 0s description: Time between running the check (ns|us|ms|s|m|h) (default 0s) - option: health-retries default_value: "0" description: Consecutive failures needed to report unhealthy - option: health-timeout - default_value: "0" + default_value: 0s description: | Maximum time to allow one check to run (ns|us|ms|s|m|h) (default 0s) - option: help @@ -241,7 +243,8 @@ options: default_value: '[]' description: Security Options - option: shm-size - description: Size of /dev/shm, default value is 64MB + default_value: "0" + description: Size of /dev/shm - option: sig-proxy default_value: "true" description: Proxy received signals to the process @@ -286,3 +289,4 @@ options: - option: workdir shorthand: w description: Working directory inside the container + diff --git a/_data/engine-cli/docker_container_start.yaml b/_data/engine-cli/docker_container_start.yaml index 38a2f3fa78..2fc04a0978 100644 --- a/_data/engine-cli/docker_container_start.yaml +++ b/_data/engine-cli/docker_container_start.yaml @@ -1,7 +1,6 @@ command: docker container start short: Start one or more stopped containers -long: | - Start one or more containers. +long: Start one or more stopped containers usage: docker container start [OPTIONS] CONTAINER [CONTAINER...] pname: docker container plink: docker_container.yaml @@ -20,3 +19,4 @@ options: shorthand: i default_value: "false" description: Attach container's STDIN + diff --git a/_data/engine-cli/docker_container_stats.yaml b/_data/engine-cli/docker_container_stats.yaml index 8e2e39677b..0599ed97d0 100644 --- a/_data/engine-cli/docker_container_stats.yaml +++ b/_data/engine-cli/docker_container_stats.yaml @@ -1,38 +1,6 @@ command: docker container stats short: Display a live stream of container(s) resource usage statistics -long: | - Display a live stream of one or more containers' resource usage statistics - - # Format - - Pretty-print containers statistics using a Go template. - Valid placeholders: - .Container - Container name or ID. - .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). - - # EXAMPLES - - Running `docker container stats` on all running containers - - $ docker container stats - CONTAINER CPU %!M(MISSING)EM USAGE / LIMIT MEM %!N(MISSING)ET I/O BLOCK I/O - 1285939c1fd3 0.07%! (MISSING)KiB / 64 MiB 1.21%! (MISSING)B / 648 B 3.568 MB / 512 KB - 9c76f7834ae2 0.07%! (MISSING)MiB / 64 MiB 4.29%! (MISSING)KB / 648 B 12.4 MB / 0 B - d1ea048f04e4 0.03%! (MISSING)MiB / 64 MiB 6.30%! (MISSING)KB / 648 B 27.7 MB / 0 B - - Running `docker container stats` on multiple containers by name and id. - - $ docker container stats fervent_panini 5acfcb1b4fd1 - CONTAINER CPU %!M(MISSING)EM USAGE/LIMIT MEM %!N(MISSING)ET I/O - 5acfcb1b4fd1 0.00%! (MISSING)MiB/1.045 GiB 11.03%! (MISSING)kB/648 B - fervent_panini 0.02%! (MISSING)MiB/1.045 GiB 1.06%! (MISSING)B/648 B +long: Display a live stream of container(s) resource usage statistics usage: docker container stats [OPTIONS] [CONTAINER...] pname: docker container plink: docker_container.yaml @@ -46,3 +14,4 @@ options: - option: no-stream default_value: "false" description: Disable streaming stats and only pull the first result + diff --git a/_data/engine-cli/docker_container_stop.yaml b/_data/engine-cli/docker_container_stop.yaml index 47567e488c..ab7aaf96db 100644 --- a/_data/engine-cli/docker_container_stop.yaml +++ b/_data/engine-cli/docker_container_stop.yaml @@ -1,7 +1,6 @@ command: docker container stop short: Stop one or more running containers -long: | - Stop a container (Send SIGTERM, and then SIGKILL after grace period) +long: Stop one or more running containers usage: docker container stop [OPTIONS] CONTAINER [CONTAINER...] pname: docker container plink: docker_container.yaml @@ -10,3 +9,4 @@ options: shorthand: t default_value: "10" description: Seconds to wait for stop before killing it + diff --git a/_data/engine-cli/docker_container_top.yaml b/_data/engine-cli/docker_container_top.yaml index c0f746c8c6..1611ccdd44 100644 --- a/_data/engine-cli/docker_container_top.yaml +++ b/_data/engine-cli/docker_container_top.yaml @@ -1,17 +1,7 @@ command: docker container top short: Display the running processes of a container -long: | - Display the running process of the container. ps-OPTION can be any of the options you would pass to a Linux ps command. - - All displayed information is from host's point of view. - - # EXAMPLES - - Run **docker container top** with the ps option of -x: - - $ docker container top 8601afda2b -x - PID TTY STAT TIME COMMAND - 16623 ? Ss 0:00 sleep 99999 +long: Display the running processes of a container usage: docker container top CONTAINER [ps OPTIONS] pname: docker container plink: docker_container.yaml + diff --git a/_data/engine-cli/docker_container_unpause.yaml b/_data/engine-cli/docker_container_unpause.yaml index e23c479699..62ca83c7aa 100644 --- a/_data/engine-cli/docker_container_unpause.yaml +++ b/_data/engine-cli/docker_container_unpause.yaml @@ -1,12 +1,7 @@ command: docker container unpause short: Unpause all processes within one or more containers -long: | - The `docker container unpause` command un-suspends all processes in a container. - On Linux, it does this using the cgroups freezer. - - See the [cgroups freezer documentation] - (https://www.kernel.org/doc/Documentation/cgroup-v1/freezer-subsystem.txt) for - further details. +long: Unpause all processes within one or more containers usage: docker container unpause CONTAINER [CONTAINER...] pname: docker container plink: docker_container.yaml + diff --git a/_data/engine-cli/docker_container_update.yaml b/_data/engine-cli/docker_container_update.yaml index 5a5ad255f6..3cb08f65d0 100644 --- a/_data/engine-cli/docker_container_update.yaml +++ b/_data/engine-cli/docker_container_update.yaml @@ -1,50 +1,6 @@ command: docker container update short: Update configuration of one or more containers -long: "The **docker container update** command dynamically updates container configuration.\nYou - can use this command to prevent containers from consuming too many \nresources from - their Docker host. With a single command, you can place \nlimits on a single container - or on many. To specify more than one container,\nprovide space-separated list of - container names or IDs.\n\nWith the exception of the **--kernel-memory** option, - you can specify these\noptions on a running or a stopped container. On kernel version - older than\n4.6, You can only update **--kernel-memory** on a stopped container - or on\na running container with kernel memory initialized.\n\n# OPTIONS\n\n## kernel-memory\n\nKernel - memory limit (format: `[]`, where unit = b, k, m or g)\n\nNote that - on kernel version older than 4.6, you can not update kernel memory on\na running - container if the container is started without kernel memory initialized,\nin this - case, it can only be updated after it's stopped. The new setting takes\neffect when - the container is started.\n\n## memory\n\nMemory limit (format: , where unit = b, k, m or g)\n\nNote that the memory should be smaller than - the already set swap memory limit.\nIf you want update a memory limit bigger than - the already set swap memory limit,\nyou should update swap memory limit at the same - time. If you don't set swap memory \nlimit on docker create/run but only memory - limit, the swap memory is double\nthe memory limit.\n\n# EXAMPLES\n\nThe following - sections illustrate ways to use this command.\n\n### Update a container's cpu-shares\n\nTo - limit a container's cpu-shares to 512, first identify the container\nname or ID. - You can use **docker ps** to find these values. You can also\nuse the ID returned - from the **docker run** command. Then, do the following:\n\n```bash\n$ docker container - update --cpu-shares 512 abebf7571666\n```\n\n### Update a container with cpu-shares - and memory\n\nTo update multiple resource configurations for multiple containers:\n\n```bash\n$ - docker container update --cpu-shares 512 -m 300M abebf7571666 hopeful_morse\n```\n\n### - Update a container's kernel memory constraints\n\nYou can update a container's kernel - memory limit using the **--kernel-memory**\noption. On kernel version older than - 4.6, this option can be updated on a\nrunning container only if the container was - started with **--kernel-memory**.\nIf the container was started *without* **--kernel-memory** - you need to stop\nthe container before updating kernel memory.\n\nFor example, if - you started a container with this command:\n\n```bash\n$ docker run -dit --name - test --kernel-memory 50M ubuntu bash\n```\n\nYou can update kernel memory while - the container is running:\n\n```bash\n$ docker container update --kernel-memory - 80M test\n```\n\nIf you started a container *without* kernel memory initialized:\n\n```bash\n$ - docker run -dit --name test2 --memory 300M ubuntu bash\n```\n\nUpdate kernel memory - of running container `test2` will fail. You need to stop\nthe container before updating - the **--kernel-memory** setting. The next time you\nstart it, the container uses - the new value.\n\nKernel version newer than (include) 4.6 does not have this limitation, - you\ncan use `--kernel-memory` the same way as other options.\n\n### Update a container's - restart policy\n\nYou can change a container's restart policy on a running container. - The new\nrestart policy takes effect instantly after you run `docker container update` - on a\ncontainer.\n\nTo update restart policy for one or more containers:\n\n```bash\n$ - docker container update --restart=on-failure:3 abebf7571666 hopeful_morse\n```\n\nNote - that if the container is started with \"--rm\" flag, you cannot update the restart\npolicy - for it. The `AutoRemove` and `RestartPolicy` are mutually exclusive for the\ncontainer.\n" +long: Update configuration of one or more containers usage: docker container update [OPTIONS] CONTAINER [CONTAINER...] pname: docker container plink: docker_container.yaml @@ -85,3 +41,4 @@ options: Swap limit equal to memory plus swap: '-1' to enable unlimited swap - option: restart description: Restart policy to apply when a container exits + diff --git a/_data/engine-cli/docker_container_wait.yaml b/_data/engine-cli/docker_container_wait.yaml index 1ef5bb52b8..3f5e051103 100644 --- a/_data/engine-cli/docker_container_wait.yaml +++ b/_data/engine-cli/docker_container_wait.yaml @@ -1,14 +1,7 @@ command: docker container wait short: Block until one or more containers stop, then print their exit codes -long: | - Block until a container stops, then print its exit code. - - # EXAMPLES - - $ docker run -d fedora sleep 99 - 079b83f558a2bc52ecad6b2a5de13622d584e6bb1aea058c11b36511e85e7622 - $ docker container wait 079b83f558a2bc - 0 +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 + diff --git a/_data/engine-cli/docker_cp.yaml b/_data/engine-cli/docker_cp.yaml index efd7ba83d8..f34fdeceb5 100644 --- a/_data/engine-cli/docker_cp.yaml +++ b/_data/engine-cli/docker_cp.yaml @@ -1,7 +1,86 @@ command: docker cp short: Copy files/folders between a container and the local filesystem -long: | - Alias for `docker container cp`. +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. 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 foo tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | tar Cxf DEST_PATH - + ``` + + ```bash + $ tar Ccf $(dirname SRC_PATH) - $(basename SRC_PATH) | docker exec -i foo 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 @@ -11,3 +90,4 @@ options: shorthand: L default_value: "false" description: Always follow symbol link in SRC_PATH + diff --git a/_data/engine-cli/docker_create.yaml b/_data/engine-cli/docker_create.yaml index 87e9d7b8cf..b091b14e19 100644 --- a/_data/engine-cli/docker_create.yaml +++ b/_data/engine-cli/docker_create.yaml @@ -1,7 +1,17 @@ command: docker create short: Create a new container -long: | - Alias for `docker container create`. +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 @@ -64,6 +74,9 @@ options: - option: device default_value: '[]' description: Add a host device to the container +- option: device-cgroup-rule + default_value: '[]' + description: Add a rule to the cgroup allowed devices list - option: device-read-bps default_value: '[]' description: Limit read rate (bytes per second) from a device @@ -109,13 +122,13 @@ options: - option: health-cmd description: Command to run to check health - option: health-interval - default_value: "0" + default_value: 0s description: Time between running the check (ns|us|ms|s|m|h) (default 0s) - option: health-retries default_value: "0" description: Consecutive failures needed to report unhealthy - option: health-timeout - default_value: "0" + default_value: 0s description: | Maximum time to allow one check to run (ns|us|ms|s|m|h) (default 0s) - option: help @@ -235,7 +248,8 @@ options: default_value: '[]' description: Security Options - option: shm-size - description: Size of /dev/shm, default value is 64MB + default_value: "0" + description: Size of /dev/shm - option: stop-signal default_value: SIGTERM description: Signal to stop a container, SIGTERM by default @@ -277,3 +291,89 @@ options: - option: workdir shorthand: w description: Working directory inside the container +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 then 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"`. + diff --git a/_data/engine-cli/docker_deploy.yaml b/_data/engine-cli/docker_deploy.yaml index a7347c7654..59557b35f0 100644 --- a/_data/engine-cli/docker_deploy.yaml +++ b/_data/engine-cli/docker_deploy.yaml @@ -1,6 +1,8 @@ command: docker deploy short: Deploy a new stack or update an existing stack -long: Deploy a new stack or update an existing stack +long: |- + Create and update a stack from a `compose` or a `dab` file on the swarm. This command + has to be run targeting a manager node. usage: docker deploy [OPTIONS] STACK pname: docker plink: docker.yaml @@ -13,3 +15,65 @@ options: - option: with-registry-auth default_value: "false" description: Send registry authentication details to Swarm agents +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 + ``` + + 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 + ``` + diff --git a/_data/engine-cli/docker_diff.yaml b/_data/engine-cli/docker_diff.yaml index cf2f7a5beb..d0b9b7a2af 100644 --- a/_data/engine-cli/docker_diff.yaml +++ b/_data/engine-cli/docker_diff.yaml @@ -1,7 +1,44 @@ command: docker diff short: Inspect changes to files or directories on a container's filesystem -long: | - Alias for `docker container diff`. +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 + ``` + diff --git a/_data/engine-cli/docker_events.yaml b/_data/engine-cli/docker_events.yaml index ec5c3c9b22..ddcca7826b 100644 --- a/_data/engine-cli/docker_events.yaml +++ b/_data/engine-cli/docker_events.yaml @@ -1,7 +1,137 @@ command: docker events short: Get real time events from the server -long: | - Alias for `docker system events`. +long: |- + Use `docker 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 events [OPTIONS] pname: docker plink: docker.yaml @@ -15,3 +145,192 @@ options: description: Show all events created since timestamp - option: until description: Stream events until this timestamp +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):** + + ```none + 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) + ``` + + ### 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) + ``` + + The `type=plugin` filter is experimental. + + ```bash + $ 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) + ``` + + ### Format the output + + ```bash + {% raw %} + $ 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 + {% endraw %} + ``` + + #### Format as JSON + + ```none + {% raw %} + $ 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.. + {% endraw %} + ``` + diff --git a/_data/engine-cli/docker_exec.yaml b/_data/engine-cli/docker_exec.yaml index 392d22d0fa..63d4cfec01 100644 --- a/_data/engine-cli/docker_exec.yaml +++ b/_data/engine-cli/docker_exec.yaml @@ -1,7 +1,11 @@ command: docker exec short: Run a command in a running container -long: | - Alias for `docker container exec`. +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. usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...] pname: docker plink: docker.yaml @@ -30,3 +34,53 @@ options: - option: user shorthand: u description: 'Username or UID (format: [:])' +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`. + + ### 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 + ``` + diff --git a/_data/engine-cli/docker_export.yaml b/_data/engine-cli/docker_export.yaml index 7d68cb3d5f..ea2b3c0177 100644 --- a/_data/engine-cli/docker_export.yaml +++ b/_data/engine-cli/docker_export.yaml @@ -1,7 +1,13 @@ command: docker export short: Export a container's filesystem as a tar archive -long: | - Alias for `docker container export`. +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/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 @@ -9,3 +15,14 @@ options: - option: output shorthand: o description: Write to a file, instead of STDOUT +examples: |- + ch of these commands has the same result. + + ```bash + $ docker export red_panda > latest.tar + ``` + + ```bash + $ docker export --output="latest.tar" red_panda + ``` + diff --git a/_data/engine-cli/docker_history.yaml b/_data/engine-cli/docker_history.yaml index dffc7cbfd5..95a134db26 100644 --- a/_data/engine-cli/docker_history.yaml +++ b/_data/engine-cli/docker_history.yaml @@ -1,7 +1,6 @@ command: docker history short: Show the history of an image -long: | - Alias for `docker image history`. +long: Show the history of an image usage: docker history [OPTIONS] IMAGE pname: docker plink: docker.yaml @@ -17,3 +16,29 @@ options: shorthand: q default_value: "false" description: Only show numeric IDs +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 or label==\n - before=([:tag]||)\n - \ - since=([:tag]||)\n\n## Format\n\n Pretty-print - images using a Go template.\n Valid placeholders:\n .ID - Image ID\n .Repository - - Image repository\n .Tag - Image tag\n .Digest - Image digest\n .CreatedSince - - Elapsed time since the image was created\n .CreatedAt - Time when the image - was created\n .Size - Image disk size\n\n# EXAMPLES\n\n## Listing the images\n\nTo - list the images in a local repository (not the registry) run:\n\n docker image - ls\n\nThe list will contain the image repository name, a tag for the image, and - an\nimage ID, when it was created and its virtual size. Columns: REPOSITORY, TAG,\nIMAGE - ID, CREATED, and SIZE.\n\nThe `docker image ls` command takes an optional `[REPOSITORY[:TAG]]` - argument\nthat restricts the list to images that match the argument. If you specify\n`REPOSITORY`but - no `TAG`, the `docker image ls` command lists all images in the\ngiven repository.\n\n - \ docker image ls java\n\nThe `[REPOSITORY[:TAG]]` value must be an \"exact match\". - This means that, for example,\n`docker image ls jav` does not match the image `java`.\n\nIf - both `REPOSITORY` and `TAG` are provided, only images matching that\nrepository - and tag are listed. To find all local images in the \"java\"\nrepository with tag - \"8\" you can use:\n\n docker image ls java:8\n\nTo get a verbose list of images - which contains all the intermediate images\nused in builds use **-a**:\n\n docker - image ls -a\n\nPreviously, the docker image ls command supported the --tree and - --dot arguments,\nwhich displayed different visualizations of the image data. Docker - core removed\nthis functionality in the 1.7 version. If you liked this functionality, - you can\nstill find it in the third-party dockviz tool: https://github.com/justone/dockviz.\n\n## - Listing images in a desired format\n\nWhen using the --format option, the image - command will either output the data \nexactly as the template declares or, when - using the `table` directive, will \ninclude column headers as well. You can use - special characters like `\\t` for\ninserting tab spacing between columns. \n\nThe - following example uses a template without headers and outputs the ID and \nRepository - entries separated by a colon for all images:\n\n docker images --format \"{{.ID}}: - {{.Repository}}\"\n 77af4d6b9913: \n b6fa739cedf5: committ\n 78a85c484bad: - ipbabble\n 30557a29d5ab: docker\n 5ed6274db6ce: \n 746b819f315e: - postgres\n 746b819f315e: postgres\n 746b819f315e: postgres\n 746b819f315e: - postgres\n\nTo list all images with their repository and tag in a table format you - can use:\n\n docker images --format \"table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\"\n - \ IMAGE ID REPOSITORY TAG\n 77af4d6b9913 - \ \n b6fa739cedf5 committ latest\n - \ 78a85c484bad ipbabble \n 30557a29d5ab docker - \ latest\n 5ed6274db6ce \n - \ 746b819f315e postgres 9\n 746b819f315e postgres - \ 9.3\n 746b819f315e postgres 9.3.5\n - \ 746b819f315e postgres latest\n\nValid template placeholders - are listed above.\n\n## Listing only the shortened image IDs\n\nListing just the - shortened image IDs. This can be useful for some automated\ntools.\n\n docker - image ls -q\n" +long: List images usage: docker image ls [OPTIONS] [REPOSITORY[:TAG]] pname: docker image plink: docker_image.yaml @@ -78,3 +25,4 @@ options: shorthand: q default_value: "false" description: Only show numeric IDs + diff --git a/_data/engine-cli/docker_image_prune.yaml b/_data/engine-cli/docker_image_prune.yaml index a56480ee20..33825347b2 100644 --- a/_data/engine-cli/docker_image_prune.yaml +++ b/_data/engine-cli/docker_image_prune.yaml @@ -15,3 +15,4 @@ options: shorthand: f default_value: "false" description: Do not prompt for confirmation + diff --git a/_data/engine-cli/docker_image_pull.yaml b/_data/engine-cli/docker_image_pull.yaml index dc4b818636..068ef8c44c 100644 --- a/_data/engine-cli/docker_image_pull.yaml +++ b/_data/engine-cli/docker_image_pull.yaml @@ -1,99 +1,6 @@ command: docker image pull short: Pull an image or a repository from a registry -long: "This command pulls down an image or a repository from a registry. If\nthere - is more than one image for a repository (e.g., fedora) then all\nimages for that - repository name can be pulled down including any tags\n(see the option **-a** or - **--all-tags**).\n\nIf you do not specify a `REGISTRY_HOST`, the command uses Docker's - public\nregistry located at `registry-1.docker.io` by default. \n\n# EXAMPLES\n\n### - Pull an image from Docker Hub\n\nTo download a particular image, or set of images - (i.e., a repository), use\n`docker image pull`. If no tag is provided, Docker Engine - uses the `:latest` tag as a\ndefault. This command pulls the `debian:latest` image:\n\n - \ $ docker image pull debian\n\n Using default tag: latest\n latest: Pulling - from library/debian\n fdd5d7827f33: Pull complete\n a3ed95caeb02: Pull complete\n - \ Digest: sha256:e7d38b3517548a1c71e41bffe9c8ae6d6d29546ce46bf62159837aad072c90aa\n - \ Status: Downloaded newer image for debian:latest\n\nDocker images can consist - of multiple layers. In the example above, the image\nconsists of two layers; `fdd5d7827f33` - and `a3ed95caeb02`.\n\nLayers can be reused by images. For example, the `debian:jessie` - image shares\nboth layers with `debian:latest`. Pulling the `debian:jessie` image - therefore\nonly pulls its metadata, but not its layers, because all layers are already\npresent - locally:\n\n $ docker image pull debian:jessie\n\n jessie: Pulling from library/debian\n - \ fdd5d7827f33: Already exists\n a3ed95caeb02: Already exists\n Digest: - sha256:a9c958be96d7d40df920e7041608f2f017af81800ca5ad23e327bc402626b58e\n Status: - Downloaded newer image for debian:jessie\n\nTo see which images are present locally, - use the **docker-images(1)**\ncommand:\n\n $ docker images\n\n REPOSITORY - \ TAG IMAGE ID CREATED SIZE\n debian jessie f50f9524513f - \ 5 days ago 125.1 MB\n debian latest f50f9524513f 5 days ago - \ 125.1 MB\n\nDocker uses a content-addressable image store, and the image ID is - a SHA256\ndigest covering the image's configuration and layers. In the example above,\n`debian:jessie` - and `debian:latest` have the same image ID because they are\nactually the *same* - image tagged with different names. Because they are the\nsame image, their layers - are stored only once and do not consume extra disk\nspace.\n\nFor more information - about images, layers, and the content-addressable store,\nrefer to [understand images, - containers, and storage drivers](https://docs.docker.com/engine/userguide/storagedriver/imagesandcontainers/)\nin - the online documentation.\n\n\n## Pull an image by digest (immutable identifier)\n\nSo - far, you've pulled images by their name (and \"tag\"). Using names and tags is\na - convenient way to work with images. When using tags, you can `docker image pull` - an\nimage again to make sure you have the most up-to-date version of that image.\nFor - example, `docker image pull ubuntu:14.04` pulls the latest version of the Ubuntu\n14.04 - image.\n\nIn some cases you don't want images to be updated to newer versions, but - prefer\nto use a fixed version of an image. Docker enables you to pull an image - by its\n*digest*. When pulling an image by digest, you specify *exactly* which version\nof - an image to pull. Doing so, allows you to \"pin\" an image to that version,\nand - guarantee that the image you're using is always the same.\n\nTo know the digest - of an image, pull the image first. Let's pull the latest\n`ubuntu:14.04` image from - Docker Hub:\n\n $ docker image pull ubuntu:14.04\n\n 14.04: Pulling from library/ubuntu\n - \ 5a132a7e7af1: Pull complete\n fd2731e4c50c: Pull complete\n 28a2f68d1120: - Pull complete\n a3ed95caeb02: Pull complete\n Digest: sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2\n - \ Status: Downloaded newer image for ubuntu:14.04\n\nDocker prints the digest - of the image after the pull has finished. In the example\nabove, the digest of the - image is:\n\n sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2\n\nDocker - also prints the digest of an image when *pushing* to a registry. This\nmay be useful - if you want to pin to a version of the image you just pushed.\n\nA digest takes - the place of the tag when pulling an image, for example, to \npull the above image - by digest, run the following command:\n\n $ docker image pull ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2\n\n - \ sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2: Pulling - from library/ubuntu\n 5a132a7e7af1: Already exists\n fd2731e4c50c: Already - exists\n 28a2f68d1120: Already exists\n a3ed95caeb02: Already exists\n Digest: - sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2\n Status: - Downloaded newer image for ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2\n\nDigest - can also be used in the `FROM` of a Dockerfile, for example:\n\n FROM ubuntu@sha256:45b23dee08af5e43a7fea6c4cf9c25ccf269ee113168c19722f87876677c5cb2\n - \ MAINTAINER some maintainer \n\n> **Note**: Using this - feature \"pins\" an image to a specific version in time.\n> Docker will therefore - not pull updated versions of an image, which may include \n> security updates. If - you want to pull an updated image, you need to change the\n> digest accordingly.\n\n## - Pulling from a different registry\n\nBy default, `docker image pull` pulls images - from Docker Hub. It is also possible to\nmanually specify the path of a registry - to pull from. For example, if you have\nset up a local registry, you can specify - its path to pull from it. A registry\npath is similar to a URL, but does not contain - a protocol specifier (`https://`).\n\nThe following command pulls the `testing/test-image` - image from a local registry\nlistening on port 5000 (`myregistry.local:5000`):\n\n - \ $ docker image pull myregistry.local:5000/testing/test-image\n\nRegistry credentials - are managed by **docker-login(1)**.\n\nDocker uses the `https://` protocol to communicate - with a registry, unless the\nregistry is allowed to be accessed over an insecure - connection. Refer to the\n[insecure registries](https://docs.docker.com/engine/reference/commandline/daemon/#insecure-registries)\nsection - in the online documentation for more information.\n\n\n## Pull a repository with - multiple images\n\nBy default, `docker image pull` pulls a *single* image from the - registry. A repository\ncan contain multiple images. To pull all images from a repository, - provide the\n`-a` (or `--all-tags`) option when using `docker image pull`.\n\nThis - command pulls all images from the `fedora` repository:\n\n $ docker image pull - --all-tags fedora\n\n Pulling repository fedora\n ad57ef8d78d7: Download complete\n - \ 105182bb5e8b: Download complete\n 511136ea3c5a: Download complete\n 73bd853d2ea5: - Download complete\n ....\n\n Status: Downloaded newer image for fedora\n\nAfter - the pull has completed use the `docker images` command to see the\nimages that were - pulled. The example below shows all the `fedora` images\nthat are present locally:\n\n - \ $ docker images fedora\n\n REPOSITORY TAG IMAGE ID CREATED - \ SIZE\n fedora rawhide ad57ef8d78d7 5 days ago 359.3 MB\n - \ fedora 20 105182bb5e8b 5 days ago 372.7 MB\n fedora heisenbug - \ 105182bb5e8b 5 days ago 372.7 MB\n fedora latest 105182bb5e8b - \ 5 days ago 372.7 MB\n\n\n## Canceling a pull\n\nKilling the `docker image - pull` process, for example by pressing `CTRL-c` while it is\nrunning in a terminal, - will terminate the pull operation.\n\n $ docker image pull fedora\n\n Using - default tag: latest\n latest: Pulling from library/fedora\n a3ed95caeb02: - Pulling fs layer\n 236608c7b546: Pulling fs layer\n ^C\n\n> **Note**: Technically, - the Engine terminates a pull operation when the\n> connection between the Docker - Engine daemon and the Docker Engine client\n> initiating the pull is lost. If the - connection with the Engine daemon is\n> lost for other reasons than a manual interaction, - the pull is also aborted.\n" +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 @@ -105,3 +12,4 @@ options: - option: disable-content-trust default_value: "true" description: Skip image verification + diff --git a/_data/engine-cli/docker_image_push.yaml b/_data/engine-cli/docker_image_push.yaml index 937c04cdce..970b82a064 100644 --- a/_data/engine-cli/docker_image_push.yaml +++ b/_data/engine-cli/docker_image_push.yaml @@ -1,40 +1,6 @@ command: docker image push short: Push an image or a repository to a registry -long: | - Use `docker image push` to share your images to the [Docker Hub](https://hub.docker.com) - registry or to a self-hosted one. - - Refer to **docker-image-tag(1)** for more information about valid image and tag names. - - Killing the **docker image push** process, for example by pressing **CTRL-c** while it - is running in a terminal, terminates the push operation. - - Registry credentials are managed by **docker-login(1)**. - - # EXAMPLES - - ## Pushing a new image to a registry - - First save the new image by finding the container ID (using **docker container ls**) - and then committing it to a new image name. Note that only a-z0-9-_. are - allowed when naming images: - - # docker container 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: - - # docker image tag rhel-httpd registry-host:5000/myadmin/rhel-httpd - # docker image push registry-host:5000/myadmin/rhel-httpd - - Check that this worked by running: - - # docker image ls - - You should see both `rhel-httpd` and `registry-host:5000/myadmin/rhel-httpd` - listed. +long: Push an image or a repository to a registry usage: docker image push [OPTIONS] NAME[:TAG] pname: docker image plink: docker_image.yaml @@ -42,3 +8,4 @@ options: - option: disable-content-trust default_value: "true" description: Skip image signing + diff --git a/_data/engine-cli/docker_image_rm.yaml b/_data/engine-cli/docker_image_rm.yaml index 101dd83f1c..b9acdd8e73 100644 --- a/_data/engine-cli/docker_image_rm.yaml +++ b/_data/engine-cli/docker_image_rm.yaml @@ -1,18 +1,7 @@ command: docker image rm aliases: rmi, remove short: Remove one or more images -long: | - Removes one or more images from the host node. 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** command. - - # EXAMPLES - - ## Removing an image - - Here is an example of removing an image: - - docker image rm fedora/httpd +long: Remove one or more images usage: docker image rm [OPTIONS] IMAGE [IMAGE...] pname: docker image plink: docker_image.yaml @@ -24,3 +13,4 @@ options: - option: no-prune default_value: "false" description: Do not delete untagged parents + diff --git a/_data/engine-cli/docker_image_save.yaml b/_data/engine-cli/docker_image_save.yaml index 4855f281a5..61984707d5 100644 --- a/_data/engine-cli/docker_image_save.yaml +++ b/_data/engine-cli/docker_image_save.yaml @@ -1,25 +1,6 @@ command: docker image 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. - - Stream to a file instead of STDOUT by using **-o**. - - # EXAMPLES - - Save all fedora repository images to a fedora-all.tar and save the latest - fedora image to a fedora-latest.tar: - - $ docker image save fedora > fedora-all.tar - $ docker image save --output=fedora-latest.tar fedora:latest - $ ls -sh fedora-all.tar - 721M fedora-all.tar - $ ls -sh fedora-latest.tar - 367M fedora-latest.tar - - # See also - **docker-image-load(1)** to load an image from a tar archive on STDIN. +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 @@ -27,3 +8,4 @@ options: - option: output shorthand: o description: Write to a file, instead of STDOUT + diff --git a/_data/engine-cli/docker_image_tag.yaml b/_data/engine-cli/docker_image_tag.yaml index 0eabd906fe..586650fc8e 100644 --- a/_data/engine-cli/docker_image_tag.yaml +++ b/_data/engine-cli/docker_image_tag.yaml @@ -1,31 +1,7 @@ command: docker image tag short: Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE -long: "Assigns a new alias to an image in a registry. An alias refers to the\nentire - image name including the optional `TAG` after the ':'. \n\n# OPTIONS\n**NAME**\n - \ The image name which is made up of slash-separated name components, \n optionally - prefixed by a registry hostname. The hostname must comply with \n standard DNS - rules, but may not contain underscores. If a hostname is \n present, it may optionally - be followed by a port number in the format \n `:8080`. If not present, the command - uses Docker's public registry located at\n `registry-1.docker.io` by default. - Name components may contain lowercase \n letters, digits and separators. A separator - is defined as a period, one or\n two underscores, or one or more dashes. A name - component may not start or end \n with a separator.\n\n**TAG**\n The tag assigned - to the image to version and distinguish images with the same\n name. The tag name - must be valid ASCII and may contain lowercase and\n uppercase letters, digits, - underscores, periods and hyphens. A tag name\n may not start with a period or - a hyphen and may contain a maximum of 128\n characters.\n\n# EXAMPLES\n\n## Tagging - an image referenced by ID\n\nTo tag a local image with ID \"0e5574283393\" into - the \"fedora\" repository with \n\"version1.0\":\n\n docker image tag 0e5574283393 - fedora/httpd:version1.0\n\n## Tagging an image referenced by Name\n\nTo tag a local - image with name \"httpd\" into the \"fedora\" repository with \n\"version1.0\":\n\n - \ docker image tag httpd fedora/httpd:version1.0\n\nNote that since the tag name - is not specified, the alias is created for an\nexisting local version `httpd:latest`.\n\n## - Tagging an image referenced by Name and Tag\n\nTo tag a local image with name \"httpd\" - and tag \"test\" into the \"fedora\"\nrepository with \"version1.0.test\":\n\n docker - image tag httpd:test fedora/httpd:version1.0.test\n\n## Tagging an image for a private - repository\n\nTo push an image to a private registry and not the central Docker\nregistry - you must tag it with the registry hostname and port (if needed).\n\n docker image - tag 0e5574283393 myregistryhost:5000/fedora/httpd:version1.0\n" +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 + diff --git a/_data/engine-cli/docker_images.yaml b/_data/engine-cli/docker_images.yaml index cb521f9cd5..03ece53ddf 100644 --- a/_data/engine-cli/docker_images.yaml +++ b/_data/engine-cli/docker_images.yaml @@ -1,7 +1,21 @@ command: docker images short: List images -long: | - Alias for `docker image ls`. +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 @@ -25,3 +39,293 @@ options: shorthand: q default_value: "false" description: Only show numeric IDs +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 + + #### 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 + ``` + + > **Note**: 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 + ``` + + ### 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 + {% raw %} + $ docker images --format "{{.ID}}: {{.Repository}}" + + 77af4d6b9913: + b6fa739cedf5: committ + 78a85c484f71: + 30557a29d5ab: docker + 5ed6274db6ce: + 746b819f315e: postgres + 746b819f315e: postgres + 746b819f315e: postgres + 746b819f315e: postgres + {% endraw %} + ``` + + To list all images with their repository and tag in a table format you + can use: + + ```bash + {% raw %} + $ 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 + {% endraw %} + ``` + diff --git a/_data/engine-cli/docker_import.yaml b/_data/engine-cli/docker_import.yaml index 544bc7e790..ab24c0268f 100644 --- a/_data/engine-cli/docker_import.yaml +++ b/_data/engine-cli/docker_import.yaml @@ -1,7 +1,18 @@ command: docker import short: Import the contents from a tarball to create a filesystem image -long: | - Alias for `docker image import`. +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 @@ -13,3 +24,49 @@ options: - option: message shorthand: m description: Set commit message for imported image +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. + diff --git a/_data/engine-cli/docker_info.yaml b/_data/engine-cli/docker_info.yaml index 9edfd80a90..ae96f478d3 100644 --- a/_data/engine-cli/docker_info.yaml +++ b/_data/engine-cli/docker_info.yaml @@ -1,7 +1,23 @@ command: docker info short: Display system-wide information -long: | - Alias for `docker system info`. +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 @@ -9,3 +25,201 @@ options: - option: format shorthand: f description: Format the output using the given Go template +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 + + 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 (client): false + Debug mode (server): 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 + + 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 + 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 (client): true + Debug Mode (server): 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 + {% raw %} + $ 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: + + ```none + E:\docker>docker info + + 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 (client): false + Debug Mode (server): 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 + ``` + diff --git a/_data/engine-cli/docker_inspect.yaml b/_data/engine-cli/docker_inspect.yaml index 9b9f3d968b..8f27800fa2 100644 --- a/_data/engine-cli/docker_inspect.yaml +++ b/_data/engine-cli/docker_inspect.yaml @@ -1,109 +1,12 @@ command: docker inspect short: Return low-level information on Docker objects -long: "This displays the low-level information on Docker object(s) (e.g. container, - \nimage, volume,network, node, service, or task) identified by name or ID. By default,\nthis - will render all results in a JSON array. If the container and image have\nthe same - name, this will return container JSON for unspecified type. If a format\nis specified, - the given template will be executed for each result.\n\n# EXAMPLES\n\nGet information - about an image when image name conflicts with the container name,\ne.g. both image - and container are named rhel7:\n\n $ docker inspect --type=image rhel7\n [\n - \ {\n \"Id\": \"fe01a428b9d9de35d29531e9994157978e8c48fa693e1bf1d221dffbbb67b170\",\n - \ \"Parent\": \"10acc31def5d6f249b548e01e8ffbaccfd61af0240c17315a7ad393d022c5ca2\",\n - \ ....\n }\n ]\n\n## Getting information on a container\n\nTo get information - on a container use its ID or instance name:\n\n $ docker inspect d2cc496561d6\n - \ [{\n \"Id\": \"d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47\",\n - \ \"Created\": \"2015-06-08T16:18:02.505155285Z\",\n \"Path\": \"bash\",\n - \ \"Args\": [],\n \"State\": {\n \"Running\": false,\n \"Paused\": - false,\n \"Restarting\": false,\n \"OOMKilled\": false,\n \"Dead\": - false,\n \"Pid\": 0,\n \"ExitCode\": 0,\n \"Error\": \"\",\n - \ \"StartedAt\": \"2015-06-08T16:18:03.643865954Z\",\n \"FinishedAt\": - \"2015-06-08T16:57:06.448552862Z\"\n },\n \"Image\": \"ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4\",\n - \ \"NetworkSettings\": {\n \"Bridge\": \"\",\n \"SandboxID\": \"6b4851d1903e16dd6a567bd526553a86664361f31036eaaa2f8454d6f4611f6f\",\n - \ \"HairpinMode\": false,\n \"LinkLocalIPv6Address\": \"\",\n \"LinkLocalIPv6PrefixLen\": - 0,\n \"Ports\": {},\n \"SandboxKey\": \"/var/run/docker/netns/6b4851d1903e\",\n - \ \"SecondaryIPAddresses\": null,\n \"SecondaryIPv6Addresses\": null,\n - \ \"EndpointID\": \"7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d\",\n - \ \"Gateway\": \"172.17.0.1\",\n \"GlobalIPv6Address\": \"\",\n \"GlobalIPv6PrefixLen\": - 0,\n \"IPAddress\": \"172.17.0.2\",\n \"IPPrefixLen\": 16,\n \"IPv6Gateway\": - \"\",\n \"MacAddress\": \"02:42:ac:12:00:02\",\n \"Networks\": {\n - \ \"bridge\": {\n \"NetworkID\": \"7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812\",\n - \ \"EndpointID\": \"7587b82f0dada3656fda26588aee72630c6fab1536d36e394b2bfbcf898c971d\",\n - \ \"Gateway\": \"172.17.0.1\",\n \"IPAddress\": \"172.17.0.2\",\n - \ \"IPPrefixLen\": 16,\n \"IPv6Gateway\": \"\",\n \"GlobalIPv6Address\": - \"\",\n \"GlobalIPv6PrefixLen\": 0,\n \"MacAddress\": - \"02:42:ac:12:00:02\"\n }\n }\n\n },\n \"ResolvConfPath\": - \"/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/resolv.conf\",\n - \ \"HostnamePath\": \"/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hostname\",\n - \ \"HostsPath\": \"/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/hosts\",\n - \ \"LogPath\": \"/var/lib/docker/containers/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47/d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47-json.log\",\n - \ \"Name\": \"/adoring_wozniak\",\n \"RestartCount\": 0,\n \"Driver\": \"devicemapper\",\n - \ \"MountLabel\": \"\",\n \"ProcessLabel\": \"\",\n \"Mounts\": [\n {\n - \ \"Source\": \"/data\",\n \"Destination\": \"/data\",\n \"Mode\": - \"ro,Z\",\n \"RW\": false\n\t\"Propagation\": \"\"\n }\n ],\n \"AppArmorProfile\": - \"\",\n \"ExecIDs\": null,\n \"HostConfig\": {\n \"Binds\": null,\n - \ \"ContainerIDFile\": \"\",\n \"Memory\": 0,\n \"MemorySwap\": - 0,\n \"CpuShares\": 0,\n \"CpuPeriod\": 0,\n \"CpusetCpus\": - \"\",\n \"CpusetMems\": \"\",\n \"CpuQuota\": 0,\n \"BlkioWeight\": - 0,\n \"OomKillDisable\": false,\n \"Privileged\": false,\n \"PortBindings\": - {},\n \"Links\": null,\n \"PublishAllPorts\": false,\n \"Dns\": - null,\n \"DnsSearch\": null,\n \"DnsOptions\": null,\n \"ExtraHosts\": - null,\n \"VolumesFrom\": null,\n \"Devices\": [],\n \"NetworkMode\": - \"bridge\",\n \"IpcMode\": \"\",\n \"PidMode\": \"\",\n \"UTSMode\": - \"\",\n \"CapAdd\": null,\n \"CapDrop\": null,\n \"RestartPolicy\": - {\n \"Name\": \"no\",\n \"MaximumRetryCount\": 0\n },\n - \ \"SecurityOpt\": null,\n \"ReadonlyRootfs\": false,\n \"Ulimits\": - null,\n \"LogConfig\": {\n \"Type\": \"json-file\",\n \"Config\": - {}\n },\n \"CgroupParent\": \"\"\n },\n \"GraphDriver\": {\n - \ \"Name\": \"devicemapper\",\n \"Data\": {\n \"DeviceId\": - \"5\",\n \"DeviceName\": \"docker-253:1-2763198-d2cc496561d6d520cbc0236b4ba88c362c446a7619992123f11c809cded25b47\",\n - \ \"DeviceSize\": \"171798691840\"\n }\n },\n \"Config\": - {\n \"Hostname\": \"d2cc496561d6\",\n \"Domainname\": \"\",\n \"User\": - \"\",\n \"AttachStdin\": true,\n \"AttachStdout\": true,\n \"AttachStderr\": - true,\n \"ExposedPorts\": null,\n \"Tty\": true,\n \"OpenStdin\": - true,\n \"StdinOnce\": true,\n \"Env\": null,\n \"Cmd\": [\n - \ \"bash\"\n ],\n \"Image\": \"fedora\",\n \"Volumes\": - null,\n \"VolumeDriver\": \"\",\n \"WorkingDir\": \"\",\n \"Entrypoint\": - null,\n \"NetworkDisabled\": false,\n \"MacAddress\": \"\",\n \"OnBuild\": - null,\n \"Labels\": {},\n \"Memory\": 0,\n \"MemorySwap\": - 0,\n \"CpuShares\": 0,\n \"Cpuset\": \"\",\n \"StopSignal\": - \"SIGTERM\"\n }\n }\n ]\n## Getting the IP address of a container instance\n\nTo - get the IP address of a container use:\n\n $ docker inspect --format='{{range - .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' d2cc496561d6\n 172.17.0.2\n\n## - Listing all port bindings\n\nOne can loop over arrays and maps in the results to - produce simple text\noutput:\n\n $ docker inspect --format='{{range $p, $conf - := .NetworkSettings.Ports}} \\\n {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' - d2cc496561d6\n 80/tcp -> 80\n\nYou can get more information about how to write - a Go template from:\nhttps://golang.org/pkg/text/template/.\n\n## Getting size information - on a container\n\n $ docker inspect -s d2cc496561d6\n [\n {\n ....\n - \ \"SizeRw\": 0,\n \"SizeRootFs\": 972,\n ....\n }\n ]\n\n## Getting - information on an image\n\nUse an image's ID or name (e.g., repository/name[:tag]) - to get information\nabout the image:\n\n $ docker inspect ded7cd95e059\n [{\n - \ \"Id\": \"ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4\",\n - \ \"Parent\": \"48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731\",\n - \ \"Comment\": \"\",\n \"Created\": \"2015-05-27T16:58:22.937503085Z\",\n \"Container\": - \"76cf7f67d83a7a047454b33007d03e32a8f474ad332c3a03c94537edd22b312b\",\n \"ContainerConfig\": - {\n \"Hostname\": \"76cf7f67d83a\",\n \"Domainname\": \"\",\n \"User\": - \"\",\n \"AttachStdin\": false,\n \"AttachStdout\": false,\n \"AttachStderr\": - false,\n \"ExposedPorts\": null,\n \"Tty\": false,\n \"OpenStdin\": - false,\n \"StdinOnce\": false,\n \"Env\": null,\n \"Cmd\": - [\n \"/bin/sh\",\n \"-c\",\n \"#(nop) ADD file:4be46382bcf2b095fcb9fe8334206b584eff60bb3fad8178cbd97697fcb2ea83 - in /\"\n ],\n \"Image\": \"48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731\",\n - \ \"Volumes\": null,\n \"VolumeDriver\": \"\",\n \"WorkingDir\": - \"\",\n \"Entrypoint\": null,\n \"NetworkDisabled\": false,\n \"MacAddress\": - \"\",\n \"OnBuild\": null,\n \"Labels\": {}\n },\n \"DockerVersion\": - \"1.6.0\",\n \"Author\": \"Lokesh Mandvekar \\u003clsm5@fedoraproject.org\\u003e\",\n - \ \"Config\": {\n \"Hostname\": \"76cf7f67d83a\",\n \"Domainname\": - \"\",\n \"User\": \"\",\n \"AttachStdin\": false,\n \"AttachStdout\": - false,\n \"AttachStderr\": false,\n \"ExposedPorts\": null,\n \"Tty\": - false,\n \"OpenStdin\": false,\n \"StdinOnce\": false,\n \"Env\": - null,\n \"Cmd\": null,\n \"Image\": \"48ecf305d2cf7046c1f5f8fcbcd4994403173441d4a7f125b1bb0ceead9de731\",\n - \ \"Volumes\": null,\n \"VolumeDriver\": \"\",\n \"WorkingDir\": - \"\",\n \"Entrypoint\": null,\n \"NetworkDisabled\": false,\n \"MacAddress\": - \"\",\n \"OnBuild\": null,\n \"Labels\": {}\n },\n \"Architecture\": - \"amd64\",\n \"Os\": \"linux\",\n \"Size\": 186507296,\n \"VirtualSize\": - 186507296,\n \"GraphDriver\": {\n \"Name\": \"devicemapper\",\n \"Data\": - {\n \"DeviceId\": \"3\",\n \"DeviceName\": \"docker-253:1-2763198-ded7cd95e059788f2586a51c275a4f151653779d6a7f4dad77c2bd34601d94e4\",\n - \ \"DeviceSize\": \"171798691840\"\n }\n }\n }\n ]\n" +long: |- + By default, `docker inspect` will render all results in a JSON array. If the container and + image have the same name, this will return container JSON for unspecified type. + 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. usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...] pname: docker plink: docker.yaml @@ -117,3 +20,79 @@ options: description: Display total file sizes if the type is container - option: type description: Return JSON for specified type +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 + {% raw %} + $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID + {% endraw %} + ``` + + ### Get an instance's MAC address + + ```bash + {% raw %} + $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' $INSTANCE_ID + {% endraw %} + ``` + + ### Get an instance's log path + + ```bash + {% raw %} + $ docker inspect --format='{{.LogPath}}' $INSTANCE_ID + {% endraw %} + ``` + + ### Get an instance's image name + + ```bash + {% raw %} + $ docker inspect --format='{{.Container.Spec.Image}}' $INSTANCE_ID + {% endraw %} + ``` + + ### List all port bindings + + You can loop over arrays and maps in the results to produce simple text + output: + + ```bash + {% raw %} + $ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID + {% endraw %} + ``` + + ### 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 + {% raw %} + $ docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID + {% endraw %} + ``` + + ### 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 + {% raw %} + $ docker inspect --format='{{json .Config}}' $INSTANCE_ID + {% endraw %} + ``` + diff --git a/_data/engine-cli/docker_kill.yaml b/_data/engine-cli/docker_kill.yaml index 0c2a6e0105..da59327d25 100644 --- a/_data/engine-cli/docker_kill.yaml +++ b/_data/engine-cli/docker_kill.yaml @@ -1,7 +1,12 @@ command: docker kill short: Kill one or more running containers -long: | - Alias for `docker container kill`. +long: |- + The main process inside the container will be sent `SIGKILL`, or any + signal specified with option `--signal`. + + > **Note**: `ENTRYPOINT` and `CMD` in the *shell* form run as a subcommand 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 @@ -10,3 +15,4 @@ options: shorthand: s default_value: KILL description: Signal to send to the container + diff --git a/_data/engine-cli/docker_load.yaml b/_data/engine-cli/docker_load.yaml index a12df8c5a3..c8b0446e39 100644 --- a/_data/engine-cli/docker_load.yaml +++ b/_data/engine-cli/docker_load.yaml @@ -1,7 +1,8 @@ command: docker load short: Load an image from a tar archive or STDIN -long: | - Alias for `docker image load`. +long: |- + `docker load` loads a tarred repository from a file or the standard input stream. + It restores both images and tags. usage: docker load [OPTIONS] pname: docker plink: docker.yaml @@ -13,3 +14,32 @@ options: shorthand: q default_value: "false" description: Suppress the load output +examples: |- + ```bash + $ docker images + + 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 + ``` + diff --git a/_data/engine-cli/docker_login.yaml b/_data/engine-cli/docker_login.yaml index 1f668bcea9..1de344428c 100644 --- a/_data/engine-cli/docker_login.yaml +++ b/_data/engine-cli/docker_login.yaml @@ -1,28 +1,60 @@ command: docker login short: Log in to a Docker registry -long: | - Log in to a Docker Registry located on the specified - `SERVER`. You can specify a URL or a `hostname` for the `SERVER` value. If you - do not specify a `SERVER`, the command uses Docker's public registry located at - `https://registry-1.docker.io/` by default. To get a username/password for Docker's public registry, create an account on Docker Hub. - - `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/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 encoded credentials in - `$HOME/.docker/config.json` on Linux or `%!U(MISSING)SERPROFILE%!/(MISSING).docker/config.json` on Windows. - - # EXAMPLES - - ## Login to a registry on your localhost - - # docker login localhost:8080 - - # See also - **docker-logout(1)** to log out from a Docker registry. +long: "Login to a registry.\n\n### Login to a self-hosted registry\n\nIf you want + to login to a self-hosted registry you can specify this by\nadding the server name.\n\n```bash\n$ + docker login localhost:8080\n```\n\n### Privileged user requirement\n\n`docker login` + requires user to use `sudo` or be `root`, except when:\n\n1. connecting to a remote + daemon, such as a `docker-machine` provisioned `docker engine`.\n2. 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/security/security/#docker-daemon-attack-surface) + for details.\n\nYou can log into any public or private repository for which you + have\ncredentials. When you log in, the command stores encoded credentials in\n`$HOME/.docker/config.json` + on Linux or `%USERPROFILE%/.docker/config.json` on Windows.\n\n### Credentials store\n\nThe + Docker Engine can keep user credentials in an external credentials store,\nsuch + as the native keychain of the operating system. Using an external store\nis more + secure than storing credentials in the Docker configuration file.\n\nTo use a credentials + store, you need an external helper program to interact\nwith a specific keychain + or external store. Docker requires the helper\nprogram to be in the client's host + `$PATH`.\n\nThis is the list of currently available credentials helpers and where\nyou + can download them from:\n\n- D-Bus Secret Service: https://github.com/docker/docker-credential-helpers/releases\n- + Apple macOS keychain: https://github.com/docker/docker-credential-helpers/releases\n- + Microsoft Windows Credential Manager: https://github.com/docker/docker-credential-helpers/releases\n\nYou + need to specify the credentials store in `$HOME/.docker/config.json`\nto tell the + docker engine to use it. The value of the config property should be\nthe suffix + of the program to use (i.e. everything after `docker-credential-`).\nFor example, + to use `docker-credential-osxkeychain`:\n\n```json\n{\n\t\"credsStore\": \"osxkeychain\"\n}\n```\n\nIf + you are currently logged in, run `docker logout` to remove\nthe credentials from + the file and run `docker login` again.\n\n### Credential helper protocol\n\nCredential + helpers can be any program or script that follows a very simple protocol.\nThis + protocol is heavily inspired by Git, but it differs in the information shared.\n\nThe + helpers always use the first argument in the command to identify the action.\nThere + are only three possible values for that argument: `store`, `get`, and `erase`.\n\nThe + `store` command takes a JSON payload from the standard input. That payload carries\nthe + server address, to identify the credential, the user name, and either a password\nor + an identity token.\n\n```json\n{\n\t\"ServerURL\": \"https://index.docker.io/v1\",\n\t\"Username\": + \"david\",\n\t\"Secret\": \"passw0rd1\"\n}\n```\n\nIf the secret being stored is + an identity token, the Username should be set to\n``.\n\nThe `store` command + can write error messages to `STDOUT` that the docker engine\nwill show if there + was an issue.\n\nThe `get` command takes a string payload from the standard input. + That payload carries\nthe server address that the docker engine needs credentials + for. This is\nan example of that payload: `https://index.docker.io/v1`.\n\nThe `get` + command writes a JSON payload to `STDOUT`. Docker reads the user name\nand password + from this payload:\n\n```json\n{\n\t\"Username\": \"david\",\n\t\"Secret\": \"passw0rd1\"\n}\n```\n\nThe + `erase` command takes a string payload from `STDIN`. That payload carries\nthe server + address that the docker engine wants to remove credentials for. This is\nan example + of that payload: `https://index.docker.io/v1`.\n\nThe `erase` command can write + error messages to `STDOUT` that the docker engine\nwill show if there was an issue.\n\n### + Credential helpers\n\nCredential helpers are similar to the credential store above, + but act as the\ndesignated programs to handle credentials for *specific registries*. + The default\ncredential store (`credsStore` or the config file itself) will not + be used for\noperations concerning credentials of the specified registries.\n\n### + Logging out\n\nIf you are currently logged in, run `docker logout` to remove\nthe + credentials from the default store.\n\nCredential helpers are specified in a similar + way to `credsStore`, but\nallow for multiple helpers to be configured at a time. + Keys specify the\nregistry domain, and values specify the suffix of the program + to use\n(i.e. everything after `docker-credential-`).\nFor example:\n\n```json\n{\n + \ \"credHelpers\": {\n \"registry.example.com\": \"registryhelper\",\n \"awesomereg.example.org\": + \"hip-star\",\n \"unicorn.example.io\": \"vcbait\"\n }\n}\n```" usage: docker login [OPTIONS] [SERVER] pname: docker plink: docker.yaml @@ -33,3 +65,4 @@ options: - option: username shorthand: u description: Username + diff --git a/_data/engine-cli/docker_logout.yaml b/_data/engine-cli/docker_logout.yaml index e4d6f45d07..082c8fcf44 100644 --- a/_data/engine-cli/docker_logout.yaml +++ b/_data/engine-cli/docker_logout.yaml @@ -1,11 +1,11 @@ command: docker logout short: Log out from a Docker registry -long: "Log out of a Docker Registry located on the specified `SERVER`. You can\nspecify - a URL or a `hostname` for the `SERVER` value. If you do not specify a\n`SERVER`, - the command attempts to log you out of Docker's public registry\nlocated at `https://registry-1.docker.io/` - by default. \n\n# EXAMPLES\n\n## Log out from a registry on your localhost\n\n - \ # docker logout localhost:8080\n\n# See also\n**docker-login(1)** to log in - to a Docker registry server.\n" +long: Log out from a Docker registry usage: docker logout [SERVER] pname: docker plink: docker.yaml +examples: |- + ```bash + $ docker logout localhost:8080 + ``` + diff --git a/_data/engine-cli/docker_logs.yaml b/_data/engine-cli/docker_logs.yaml index ddd75192d4..72bea5f281 100644 --- a/_data/engine-cli/docker_logs.yaml +++ b/_data/engine-cli/docker_logs.yaml @@ -1,7 +1,41 @@ command: docker logs short: Fetch the logs of a container -long: | - Alias for `docker container logs`. +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/engine/admin/logging/overview/). + + 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 @@ -23,3 +57,4 @@ options: shorthand: t default_value: "false" description: Show timestamps + diff --git a/_data/engine-cli/docker_network.yaml b/_data/engine-cli/docker_network.yaml index 60b18974de..6dc75571fc 100644 --- a/_data/engine-cli/docker_network.yaml +++ b/_data/engine-cli/docker_network.yaml @@ -20,3 +20,4 @@ clink: - docker_network_ls.yaml - docker_network_prune.yaml - docker_network_rm.yaml + diff --git a/_data/engine-cli/docker_network_connect.yaml b/_data/engine-cli/docker_network_connect.yaml index 242d2272e4..6221dc6402 100644 --- a/_data/engine-cli/docker_network_connect.yaml +++ b/_data/engine-cli/docker_network_connect.yaml @@ -1,45 +1,6 @@ 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. - - ```bash - $ docker network connect multi-host-network container1 - ``` - - 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 --ip 172.20.88.22 --ip6 2001:db8::8822 busybox - ``` - 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. +long: Connect a container to a network usage: docker network connect [OPTIONS] NETWORK CONTAINER pname: docker network plink: docker_network.yaml @@ -57,3 +18,4 @@ options: - option: link-local-ip default_value: '[]' description: Add a link-local address for the container + diff --git a/_data/engine-cli/docker_network_create.yaml b/_data/engine-cli/docker_network_create.yaml index 223c76d6bf..01dcc3d359 100644 --- a/_data/engine-cli/docker_network_create.yaml +++ b/_data/engine-cli/docker_network_create.yaml @@ -1,63 +1,6 @@ command: docker network create short: Create a network -long: "Creates a new network. The `DRIVER` accepts `bridge` or `overlay` which are - the\nbuilt-in network drivers. If you have installed a third party or your own custom\nnetwork - driver you can specify that `DRIVER` here also. If you don't specify the\n`--driver` - option, the command automatically creates a `bridge` network for you.\nWhen you - install Docker Engine it creates a `bridge` network automatically. This\nnetwork - corresponds to the `docker0` bridge that Engine has traditionally relied\non. When - launch a new container with `docker run` it automatically connects to\nthis bridge - network. You cannot remove this default bridge network but you can\ncreate new ones - using the `network create` command.\n\n```bash\n$ docker network create -d bridge - my-bridge-network\n```\n\nBridge networks are isolated networks on a single Engine - installation. If you\nwant to create a network that spans multiple Docker hosts - each running an\nEngine, you must create an `overlay` network. Unlike `bridge` networks - overlay\nnetworks require some pre-existing conditions before you can create one. - These\nconditions are:\n\n* Access to a key-value store. Engine supports Consul, - Etcd, and Zookeeper (Distributed store) key-value stores.\n* A cluster of hosts - with connectivity to the key-value store.\n* A properly configured Engine `daemon` - on each host in the cluster.\n\nThe `dockerd` options that support the `overlay` - network are:\n\n* `--cluster-store`\n* `--cluster-store-opt`\n* `--cluster-advertise`\n\nTo - read more about these options and how to configure them, see [\"*Get started\nwith - multi-host\nnetwork*\"](https://docs.docker.com/engine/userguide/networking/get-started-overlay/).\n\nIt - is also a good idea, though not required, that you install Docker Swarm on to\nmanage - the cluster that makes up your network. Swarm provides sophisticated\ndiscovery - and server management that can assist your implementation.\n\nOnce you have prepared - the `overlay` network prerequisites you simply choose a\nDocker host in the cluster - and issue the following to create the network:\n\n```bash\n$ docker network create - -d overlay my-multihost-network\n```\n\nNetwork names must be unique. The Docker - daemon attempts to identify naming\nconflicts but this is not guaranteed. It is - the user's responsibility to avoid\nname conflicts.\n\n## Connect containers\n\nWhen - you start a container use the `--network` flag to connect it to a network.\nThis - adds the `busybox` container to the `mynet` network.\n\n```bash\n$ docker run -itd - --network=mynet busybox\n```\n\nIf you want to add a container to a network after - the container is already\nrunning use the `docker network connect` subcommand.\n\nYou - can connect multiple containers to the same network. Once connected, the\ncontainers - can communicate using only another container's IP address or name.\nFor `overlay` - networks or custom plugins that support multi-host connectivity,\ncontainers connected - to the same multi-host network but launched from different\nEngines can also communicate - in this way.\n\nYou can disconnect a container from a network using the `docker - network\ndisconnect` command.\n\n## Specifying advanced options\n\nWhen you create - a network, Engine creates a non-overlapping subnetwork for the\nnetwork by default. - This subnetwork is not a subdivision of an existing network.\nIt is purely for ip-addressing - purposes. You can override this default and\nspecify subnetwork values directly - using the `--subnet` option. On a\n`bridge` network you can only create a single - subnet:\n\n```bash\n$ docker network create -d bridge --subnet=192.168.0.0/16 br0\n```\n\nAdditionally, - you also specify the `--gateway` `--ip-range` and `--aux-address`\noptions.\n\n```bash\n$ - docker network create \\\n --driver=bridge \\\n --subnet=172.28.0.0/16 \\\n --ip-range=172.28.5.0/24 - \\\n --gateway=172.28.5.254 \\\n br0\n```\n\nIf you omit the `--gateway` flag - the Engine selects one for you from inside a\npreferred pool. For `overlay` networks - and for network driver plugins that\nsupport it you can create multiple subnetworks.\n\n```bash\n$ - docker network create -d overlay \\\n --subnet=192.168.0.0/16 \\\n --subnet=192.170.0.0/16 - \\\n --gateway=192.168.0.100 \\ \n --gateway=192.170.0.100 \\\n --ip-range=192.168.1.0/24 - \\\n --aux-address=\"my-router=192.168.1.5\" --aux-address=\"my-switch=192.168.1.6\" - \\\n --aux-address=\"my-printer=192.170.1.5\" --aux-address=\"my-nas=192.170.1.6\" - \\\n my-multihost-network\n```\n\nBe sure that your subnetworks do not overlap. - If they do, the network create\nfails and Engine returns an error.\n\n### Network - internal mode\n\nBy default, when you connect a container to an `overlay` network, - Docker also\nconnects a bridge network to it to provide external connectivity. If - you want\nto create an externally isolated `overlay` network, you can specify the\n`--internal` - option.\n" +long: Create a network usage: docker network create [OPTIONS] NETWORK pname: docker network plink: docker_network.yaml @@ -100,3 +43,4 @@ options: - option: subnet default_value: '[]' description: Subnet in CIDR format that represents a network segment + diff --git a/_data/engine-cli/docker_network_disconnect.yaml b/_data/engine-cli/docker_network_disconnect.yaml index 87fca9d5bf..0402ba7d8f 100644 --- a/_data/engine-cli/docker_network_disconnect.yaml +++ b/_data/engine-cli/docker_network_disconnect.yaml @@ -1,11 +1,6 @@ command: docker network disconnect short: Disconnect a container from a network -long: | - Disconnects a container from a network. - - ```bash - $ docker network disconnect multi-host-network container1 - ``` +long: Disconnect a container from a network usage: docker network disconnect [OPTIONS] NETWORK CONTAINER pname: docker network plink: docker_network.yaml @@ -14,3 +9,4 @@ options: shorthand: f default_value: "false" description: Force the container to disconnect from a network + diff --git a/_data/engine-cli/docker_network_inspect.yaml b/_data/engine-cli/docker_network_inspect.yaml index 733ceca4bc..00d78ec459 100644 --- a/_data/engine-cli/docker_network_inspect.yaml +++ b/_data/engine-cli/docker_network_inspect.yaml @@ -1,94 +1,6 @@ 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. For example, if you connect two containers to the default `bridge` network: - - ```bash - $ sudo docker run -itd --name=container1 busybox - f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27 - - $ sudo docker run -itd --name=container2 busybox - bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727 - ``` - - The `network inspect` command shows the containers, by id, in its - results. 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. - - ```bash - $ sudo docker network inspect bridge - [ - { - "Name": "bridge", - "Id": "b2b1a2cba717161d984383fd68218cf70bbbd17d328496885f7c921333228b0f", - "Scope": "local", - "Driver": "bridge", - "IPAM": { - "Driver": "default", - "Config": [ - { - "Subnet": "172.17.42.1/16", - "Gateway": "172.17.42.1" - } - ] - }, - "Internal": false, - "Containers": { - "bda12f8922785d1f160be70736f26c1e331ab8aaf8ed8d56728508f2e2fd4727": { - "Name": "container2", - "EndpointID": "0aebb8fcd2b282abe1365979536f21ee4ceaf3ed56177c628eae9f706e00e019", - "MacAddress": "02:42:ac:11:00:02", - "IPv4Address": "172.17.0.2/16", - "IPv6Address": "" - }, - "f2870c98fd504370fb86e59f32cd0753b1ac9b69b7d80566ffc7192a82b3ed27": { - "Name": "container1", - "EndpointID": "a00676d9c91a96bbe5bcfb34f705387a33d7cc365bac1a29e4e9728df92d10ad", - "MacAddress": "02:42:ac:11:00:01", - "IPv4Address": "172.17.0.1/16", - "IPv6Address": "" - } - }, - "Options": { - "com.docker.network.bridge.default_bridge": "true", - "com.docker.network.bridge.enable_icc": "true", - "com.docker.network.bridge.enable_ip_masquerade": "true", - "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", - "com.docker.network.bridge.name": "docker0", - "com.docker.network.driver.mtu": "1500" - } - } - ] - ``` - - Returns the information about the user-defined network: - - ```bash - $ docker network create simple-network - 69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a - $ docker network inspect simple-network - [ - { - "Name": "simple-network", - "Id": "69568e6336d8c96bbf57869030919f7c69524f71183b44d80948bd3927c87f6a", - "Scope": "local", - "Driver": "bridge", - "IPAM": { - "Driver": "default", - "Config": [ - { - "Subnet": "172.22.0.0/16", - "Gateway": "172.22.0.1" - } - ] - }, - "Containers": {}, - "Options": {} - } - ] - ``` +long: Display detailed information on one or more networks usage: docker network inspect [OPTIONS] NETWORK [NETWORK...] pname: docker network plink: docker_network.yaml @@ -96,3 +8,4 @@ options: - option: format shorthand: f description: Format the output using the given Go template + diff --git a/_data/engine-cli/docker_network_ls.yaml b/_data/engine-cli/docker_network_ls.yaml index fb0441f074..2132e7a628 100644 --- a/_data/engine-cli/docker_network_ls.yaml +++ b/_data/engine-cli/docker_network_ls.yaml @@ -1,67 +1,7 @@ command: docker network ls aliases: list short: List networks -long: "Lists all the networks the Engine `daemon` knows about. This includes the\nnetworks - that span across multiple hosts in a cluster, for example:\n\n```bash\n $ docker - network ls\n NETWORK ID NAME DRIVER SCOPE\n - \ 7fca4eb8c647 bridge bridge local\n 9f904ee27bf5 - \ none null local\n cf03ee007fb4 host - \ host local\n 78b03ee04fc4 multi-host overlay - \ swarm\n```\n\nUse the `--no-trunc` option to display the full network id:\n\n```bash\n$ - docker network ls --no-trunc\nNETWORK ID NAME - \ DRIVER\n18a2866682b85619a026c81b98a5e375bd33e1b0936a26cc497c283d27bae9b3 - \ none null \nc288470c46f6c8949c5f7e5099b5b7947b07eabe8d9a27d79a9cbf111adcbf47 - \ host host \n7b369448dccbf865d397c8d2be0cda7cf7edc6b0945f77d2529912ae917a0185 - \ bridge bridge \n95e74588f40db048e86320c6526440c504650a1ff3e9f7d60a497c4d2163e5bd - \ foo bridge \n63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161 - \ dev bridge\n```\n\n## Filtering\n\nThe filtering flag (`-f` or - `--filter`) format is a `key=value` pair. If there\nis more than one filter, then - pass multiple flags (e.g. `--filter \"foo=bar\" --filter \"bif=baz\"`).\nMultiple - filter flags are combined as an `OR` filter. For example, \n`-f type=custom -f type=builtin` - returns both `custom` and `builtin` networks.\n\nThe currently supported filters - are:\n\n* driver\n* id (network's id)\n* label (`label=` or `label==`)\n* - name (network's name)\n* type (custom|builtin)\n\n#### Driver\n\nThe `driver` filter - matches networks based on their driver.\n\nThe following example matches networks - with the `bridge` driver:\n\n```bash\n$ docker network ls --filter driver=bridge\nNETWORK - ID NAME DRIVER\ndb9db329f835 test1 bridge\nf6e212da9dfd - \ test2 bridge\n```\n\n#### ID\n\nThe `id` filter matches on - all or part of a network's ID.\n\nThe following filter matches all networks with - an ID containing the\n`63d1ff1f77b0...` string.\n\n```bash\n$ docker network ls - --filter id=63d1ff1f77b07ca51070a8c227e962238358bd310bde1529cf62e6c307ade161\nNETWORK - ID NAME DRIVER\n63d1ff1f77b0 dev bridge\n```\n\nYou - can also filter for a substring in an ID as this shows:\n\n```bash\n$ docker network - ls --filter id=95e74588f40d\nNETWORK ID NAME DRIVER\n95e74588f40d - \ foo bridge\n\n$ docker network ls --filter id=95e\nNETWORK - ID NAME DRIVER\n95e74588f40d foo bridge\n```\n\n#### - Label\n\nThe `label` filter matches networks based on the presence of a `label` - alone or a `label` and a\nvalue.\n\nThe following filter matches networks with the - `usage` label regardless of its value.\n\n```bash\n$ docker network ls -f \"label=usage\"\nNETWORK - ID NAME DRIVER\ndb9db329f835 test1 bridge - \ \nf6e212da9dfd test2 bridge\n```\n\nThe following - filter matches networks with the `usage` label with the `prod` value.\n\n```bash\n$ - docker network ls -f \"label=usage=prod\"\nNETWORK ID NAME DRIVER\nf6e212da9dfd - \ test2 bridge\n```\n\n#### Name\n\nThe `name` filter matches - on all or part of a network's name.\n\nThe following filter matches all networks - with a name containing the `foobar` string.\n\n```bash\n$ docker network ls --filter - name=foobar\nNETWORK ID NAME DRIVER\n06e7eef0a170 foobar - \ bridge\n```\n\nYou can also filter for a substring in a name as this - shows:\n\n```bash\n$ docker network ls --filter name=foo\nNETWORK ID NAME - \ DRIVER\n95e74588f40d foo bridge\n06e7eef0a170 - \ foobar bridge\n```\n\n#### Type\n\nThe `type` filter supports - two values; `builtin` displays predefined networks\n(`bridge`, `none`, `host`), - whereas `custom` displays user defined networks.\n\nThe following filter matches - all user defined networks:\n\n```bash\n$ docker network ls --filter type=custom\nNETWORK - ID NAME DRIVER\n95e74588f40d foo bridge\n63d1ff1f77b0 - \ dev bridge\n```\n\nBy having this flag it allows for batch - cleanup. For example, use this filter\nto delete all user defined networks:\n\n```bash\n$ - docker network rm `docker network ls --filter type=custom -q`\n```\n\nA warning - will be issued when trying to remove a network that has containers\nattached.\n\n## - Format\n\nFormat uses a Go template to print the output. The following variables - are \nsupported: \n\n* .ID - Network ID\n* .Name - Network name\n* .Driver - Network - driver\n* .Scope - Network scope (local, global)\n* .IPv6 - Whether IPv6 is enabled - on the network or not\n* .Internal - Whether the network is internal or not\n* .Labels - - All labels assigned to the network\n* .Label - Value of a specific label for this - network. For example `{{.Label \"project.version\"}}`\n" +long: List networks usage: docker network ls [OPTIONS] pname: docker network plink: docker_network.yaml @@ -78,3 +18,4 @@ options: shorthand: q default_value: "false" description: Only display network IDs + diff --git a/_data/engine-cli/docker_network_prune.yaml b/_data/engine-cli/docker_network_prune.yaml index 147c815bda..d8344b490a 100644 --- a/_data/engine-cli/docker_network_prune.yaml +++ b/_data/engine-cli/docker_network_prune.yaml @@ -11,3 +11,4 @@ options: shorthand: f default_value: "false" description: Do not prompt for confirmation + diff --git a/_data/engine-cli/docker_network_rm.yaml b/_data/engine-cli/docker_network_rm.yaml index aadab50de0..962a58d7e2 100644 --- a/_data/engine-cli/docker_network_rm.yaml +++ b/_data/engine-cli/docker_network_rm.yaml @@ -1,27 +1,8 @@ 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. - To remove the network named 'my-network': - - ```bash - $ docker network rm my-network - ``` - - 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. +long: Remove one or more networks usage: docker network rm NETWORK [NETWORK...] pname: docker network plink: docker_network.yaml + diff --git a/_data/engine-cli/docker_node.yaml b/_data/engine-cli/docker_node.yaml index c079518a23..450d959e0d 100644 --- a/_data/engine-cli/docker_node.yaml +++ b/_data/engine-cli/docker_node.yaml @@ -20,3 +20,4 @@ clink: - docker_node_ps.yaml - docker_node_rm.yaml - docker_node_update.yaml + diff --git a/_data/engine-cli/docker_node_demote.yaml b/_data/engine-cli/docker_node_demote.yaml index 282c0971fa..f3707d2de3 100644 --- a/_data/engine-cli/docker_node_demote.yaml +++ b/_data/engine-cli/docker_node_demote.yaml @@ -4,3 +4,4 @@ long: Demote one or more nodes from manager in the swarm usage: docker node demote NODE [NODE...] pname: docker node plink: docker_node.yaml + diff --git a/_data/engine-cli/docker_node_inspect.yaml b/_data/engine-cli/docker_node_inspect.yaml index 7b3af8991f..3025dea964 100644 --- a/_data/engine-cli/docker_node_inspect.yaml +++ b/_data/engine-cli/docker_node_inspect.yaml @@ -11,3 +11,4 @@ options: - option: pretty default_value: "false" description: Print the information in a human friendly format. + diff --git a/_data/engine-cli/docker_node_ls.yaml b/_data/engine-cli/docker_node_ls.yaml index 4153feb83f..dcf62ec2a6 100644 --- a/_data/engine-cli/docker_node_ls.yaml +++ b/_data/engine-cli/docker_node_ls.yaml @@ -13,3 +13,4 @@ options: shorthand: q default_value: "false" description: Only display IDs + diff --git a/_data/engine-cli/docker_node_promote.yaml b/_data/engine-cli/docker_node_promote.yaml index ee12b6d7b6..c71d341c37 100644 --- a/_data/engine-cli/docker_node_promote.yaml +++ b/_data/engine-cli/docker_node_promote.yaml @@ -4,3 +4,4 @@ long: Promote one or more nodes to manager in the swarm usage: docker node promote NODE [NODE...] pname: docker node plink: docker_node.yaml + diff --git a/_data/engine-cli/docker_node_ps.yaml b/_data/engine-cli/docker_node_ps.yaml index e17c1612c7..6f5cb4e5c9 100644 --- a/_data/engine-cli/docker_node_ps.yaml +++ b/_data/engine-cli/docker_node_ps.yaml @@ -14,3 +14,4 @@ options: - option: no-trunc default_value: "false" description: Do not truncate output + diff --git a/_data/engine-cli/docker_node_rm.yaml b/_data/engine-cli/docker_node_rm.yaml index 9481141a32..6efb2bb0d0 100644 --- a/_data/engine-cli/docker_node_rm.yaml +++ b/_data/engine-cli/docker_node_rm.yaml @@ -10,3 +10,4 @@ options: shorthand: f default_value: "false" description: Force remove a node from the swarm + diff --git a/_data/engine-cli/docker_node_update.yaml b/_data/engine-cli/docker_node_update.yaml index bf7187c6dd..04e28fca01 100644 --- a/_data/engine-cli/docker_node_update.yaml +++ b/_data/engine-cli/docker_node_update.yaml @@ -15,3 +15,4 @@ options: description: Remove a node label if exists - option: role description: Role of the node (worker/manager) + diff --git a/_data/engine-cli/docker_pause.yaml b/_data/engine-cli/docker_pause.yaml index f6420665b7..1552d106f1 100644 --- a/_data/engine-cli/docker_pause.yaml +++ b/_data/engine-cli/docker_pause.yaml @@ -1,7 +1,21 @@ command: docker pause short: Pause all processes within one or more containers -long: | - Alias for `docker container pause`. +long: |- + The `docker pause` command suspends all processes in the specified containers. + On Linux, this uses the cgroups freezer. Traditionally, when suspending a process + the `SIGSTOP` signal is used, which is observable by the process being suspended. + With the cgroups freezer 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 + [cgroups freezer 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 + ``` + diff --git a/_data/engine-cli/docker_plugin.yaml b/_data/engine-cli/docker_plugin.yaml index bd0e6572e5..52c3ade3af 100644 --- a/_data/engine-cli/docker_plugin.yaml +++ b/_data/engine-cli/docker_plugin.yaml @@ -14,6 +14,7 @@ cname: - docker plugin push - docker plugin rm - docker plugin set +- docker plugin upgrade clink: - docker_plugin_create.yaml - docker_plugin_disable.yaml @@ -24,3 +25,5 @@ clink: - docker_plugin_push.yaml - docker_plugin_rm.yaml - docker_plugin_set.yaml +- docker_plugin_upgrade.yaml + diff --git a/_data/engine-cli/docker_plugin_create.yaml b/_data/engine-cli/docker_plugin_create.yaml index ba4b3da251..9d3b227107 100644 --- a/_data/engine-cli/docker_plugin_create.yaml +++ b/_data/engine-cli/docker_plugin_create.yaml @@ -10,3 +10,4 @@ options: - option: compress default_value: "false" description: Compress the context using gzip + diff --git a/_data/engine-cli/docker_plugin_disable.yaml b/_data/engine-cli/docker_plugin_disable.yaml index e29d142910..7fbfe4420a 100644 --- a/_data/engine-cli/docker_plugin_disable.yaml +++ b/_data/engine-cli/docker_plugin_disable.yaml @@ -9,3 +9,4 @@ options: shorthand: f default_value: "false" description: Force the disable of an active plugin + diff --git a/_data/engine-cli/docker_plugin_enable.yaml b/_data/engine-cli/docker_plugin_enable.yaml index 1ba94b4185..3cced35826 100644 --- a/_data/engine-cli/docker_plugin_enable.yaml +++ b/_data/engine-cli/docker_plugin_enable.yaml @@ -8,3 +8,4 @@ options: - option: timeout default_value: "0" description: HTTP client timeout (in seconds) + diff --git a/_data/engine-cli/docker_plugin_inspect.yaml b/_data/engine-cli/docker_plugin_inspect.yaml index f4b0911f86..73da12612b 100644 --- a/_data/engine-cli/docker_plugin_inspect.yaml +++ b/_data/engine-cli/docker_plugin_inspect.yaml @@ -8,3 +8,4 @@ options: - option: format shorthand: f description: Format the output using the given Go template + diff --git a/_data/engine-cli/docker_plugin_install.yaml b/_data/engine-cli/docker_plugin_install.yaml index 81ee03d8fe..e5c6c45641 100644 --- a/_data/engine-cli/docker_plugin_install.yaml +++ b/_data/engine-cli/docker_plugin_install.yaml @@ -16,3 +16,4 @@ options: - option: grant-all-permissions default_value: "false" description: Grant all permissions necessary to run the plugin + diff --git a/_data/engine-cli/docker_plugin_ls.yaml b/_data/engine-cli/docker_plugin_ls.yaml index 9308dbe131..925ef7a1ac 100644 --- a/_data/engine-cli/docker_plugin_ls.yaml +++ b/_data/engine-cli/docker_plugin_ls.yaml @@ -6,6 +6,9 @@ usage: docker plugin ls [OPTIONS] pname: docker plugin plink: docker_plugin.yaml options: +- option: filter + shorthand: f + description: Provide filter values (e.g. 'enabled=true') - option: format description: Pretty-print plugins using a Go template - option: no-trunc @@ -15,3 +18,4 @@ options: shorthand: q default_value: "false" description: Only display plugin IDs + diff --git a/_data/engine-cli/docker_plugin_push.yaml b/_data/engine-cli/docker_plugin_push.yaml index 529c1ebe05..5da1367ff7 100644 --- a/_data/engine-cli/docker_plugin_push.yaml +++ b/_data/engine-cli/docker_plugin_push.yaml @@ -8,3 +8,4 @@ options: - option: disable-content-trust default_value: "true" description: Skip image signing + diff --git a/_data/engine-cli/docker_plugin_rm.yaml b/_data/engine-cli/docker_plugin_rm.yaml index 026789d886..6ad7750827 100644 --- a/_data/engine-cli/docker_plugin_rm.yaml +++ b/_data/engine-cli/docker_plugin_rm.yaml @@ -10,3 +10,4 @@ options: shorthand: f default_value: "false" description: Force the removal of an active plugin + diff --git a/_data/engine-cli/docker_plugin_set.yaml b/_data/engine-cli/docker_plugin_set.yaml index 2aa6ff26b4..66a4af066e 100644 --- a/_data/engine-cli/docker_plugin_set.yaml +++ b/_data/engine-cli/docker_plugin_set.yaml @@ -4,3 +4,4 @@ long: Change settings for a plugin usage: docker plugin set PLUGIN KEY=VALUE [KEY=VALUE...] pname: docker plugin plink: docker_plugin.yaml + diff --git a/_data/engine-cli/docker_plugin_upgrade.yaml b/_data/engine-cli/docker_plugin_upgrade.yaml new file mode 100644 index 0000000000..8934ff7b7c --- /dev/null +++ b/_data/engine-cli/docker_plugin_upgrade.yaml @@ -0,0 +1,18 @@ +command: docker plugin upgrade +short: Upgrade an existing plugin +long: Upgrade an existing plugin +usage: docker plugin upgrade [OPTIONS] PLUGIN [REMOTE] +pname: docker plugin +plink: docker_plugin.yaml +options: +- option: disable-content-trust + default_value: "true" + description: Skip image verification +- option: grant-all-permissions + default_value: "false" + description: Grant all permissions necessary to run the plugin +- option: skip-remote-check + default_value: "false" + description: | + Do not check if specified remote plugin matches existing plugin image + diff --git a/_data/engine-cli/docker_port.yaml b/_data/engine-cli/docker_port.yaml index 32b5a21cc3..00550b9ddb 100644 --- a/_data/engine-cli/docker_port.yaml +++ b/_data/engine-cli/docker_port.yaml @@ -1,7 +1,27 @@ command: docker port short: List port mappings or a specific mapping for the container -long: | - Alias for `docker container port`. +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 + ``` + diff --git a/_data/engine-cli/docker_ps.yaml b/_data/engine-cli/docker_ps.yaml index 7124bf9953..0cf2bdf012 100644 --- a/_data/engine-cli/docker_ps.yaml +++ b/_data/engine-cli/docker_ps.yaml @@ -1,7 +1,6 @@ command: docker ps short: List containers -long: | - Alias for `docker container ls`. +long: List containers usage: docker ps [OPTIONS] pname: docker plink: docker.yaml @@ -34,3 +33,393 @@ options: shorthand: s default_value: "false" description: Display total file sizes +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. + + ### 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 (container's id) + * label (`label=` or `label==`) + * name (container's name) + * exited (int - the code of exited containers. Only useful with `--all`) + * status (created|restarting|running|removing|paused|exited|dead) + * ancestor (`[:]`, `` or ``) - filters containers that were created from the given image or a descendant. + * before (container's id or name) - filters containers created before given id or name + * since (container's id or name) - filters containers created since given id or name + * isolation (default|process|hyperv) (Windows daemon only) + * volume (volume name or mount point) - filters containers that mount volumes. + * network (network id or name) - filters containers connected to the provided network + * health (starting|healthy|unhealthy|none) - filters containers based on healthcheck status + * publish=(container's published port) - filters published ports by containers + * expose=(container's exposed port) - filters exposed ports by containers + + #### 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. + + ```none + $ 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 + {% raw %} + $ 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 + {% endraw %} + ``` + + #### 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 + {% raw %} + $ docker network inspect --format "{{.ID}}" net1 + {% endraw %} + + 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 `'{% raw %}{{.Label "com.docker.swarm.cpu"}}{% endraw %}'` + `.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 + {% raw %} + $ docker ps --format "{{.ID}}: {{.Command}}" + {% endraw %} + + 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 + {% raw %} + $ docker ps --format "table {{.ID}}\t{{.Labels}}" + {% endraw %} + + 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 + ``` + diff --git a/_data/engine-cli/docker_pull.yaml b/_data/engine-cli/docker_pull.yaml index cd110e8486..90ef2a1853 100644 --- a/_data/engine-cli/docker_pull.yaml +++ b/_data/engine-cli/docker_pull.yaml @@ -1,7 +1,30 @@ command: docker pull short: Pull an image or a repository from a registry -long: | - Alias for `docker image pull`. +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/engine/admin/systemd/#http-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 @@ -13,3 +36,202 @@ options: - option: disable-content-trust default_value: "true" description: Skip image verification +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/engine/userguide/storagedriver/imagesandcontainers/). + + + ### 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**: Technically, 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. + diff --git a/_data/engine-cli/docker_push.yaml b/_data/engine-cli/docker_push.yaml index 374fac44ab..3362444241 100644 --- a/_data/engine-cli/docker_push.yaml +++ b/_data/engine-cli/docker_push.yaml @@ -1,7 +1,23 @@ command: docker push short: Push an image or a repository to a registry -long: | - Alias for `docker image push`. +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. + + 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 @@ -9,3 +25,34 @@ options: - option: disable-content-trust default_value: "true" description: Skip image signing +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. + diff --git a/_data/engine-cli/docker_rename.yaml b/_data/engine-cli/docker_rename.yaml index e76d113c1e..d1af0fbd3c 100644 --- a/_data/engine-cli/docker_rename.yaml +++ b/_data/engine-cli/docker_rename.yaml @@ -1,7 +1,11 @@ command: docker rename short: Rename a container -long: | - Alias for `docker container rename`. +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 + ``` + diff --git a/_data/engine-cli/docker_restart.yaml b/_data/engine-cli/docker_restart.yaml index 4c2e2ef708..2814a576eb 100644 --- a/_data/engine-cli/docker_restart.yaml +++ b/_data/engine-cli/docker_restart.yaml @@ -1,7 +1,6 @@ command: docker restart short: Restart one or more containers -long: | - Alias for `docker container restart`. +long: Restart one or more containers usage: docker restart [OPTIONS] CONTAINER [CONTAINER...] pname: docker plink: docker.yaml @@ -10,3 +9,8 @@ options: shorthand: t default_value: "10" description: Seconds to wait for stop before killing the container +examples: |- + ```bash + $ docker restart my_container + ``` + diff --git a/_data/engine-cli/docker_rm.yaml b/_data/engine-cli/docker_rm.yaml index cc7c395306..aa30c51914 100644 --- a/_data/engine-cli/docker_rm.yaml +++ b/_data/engine-cli/docker_rm.yaml @@ -1,7 +1,6 @@ command: docker rm short: Remove one or more containers -long: | - Alias for `docker container rm`. +long: Remove one or more containers usage: docker rm [OPTIONS] CONTAINER [CONTAINER...] pname: docker plink: docker.yaml @@ -18,3 +17,74 @@ options: shorthand: v default_value: "false" description: Remove the volumes associated with the container +examples: |- + ### Remove a container + + This will remove the container referenced under the link + `/redis`. + + ```bash + $ docker rm /redis + + /redis + ``` + + ### Remove a link specified with `--link` on the default bridge network + + This will remove 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 will force-remove 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 will delete all stopped containers. The command + `docker ps -a -q` will return all existing container IDs and pass them to + the `rm` command which will delete them. Any running containers will not be + deleted. + + ### Remove a container and its volumes + + ```bash + $ docker rm -v redis + redis + ``` + + This command will remove 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` will remain intact, but the volume for + `/bar` will be removed. The same behavior holds for volumes inherited with + `--volumes-from`. + diff --git a/_data/engine-cli/docker_rmi.yaml b/_data/engine-cli/docker_rmi.yaml index f86f050536..017cda4509 100644 --- a/_data/engine-cli/docker_rmi.yaml +++ b/_data/engine-cli/docker_rmi.yaml @@ -1,7 +1,6 @@ command: docker rmi short: Remove one or more images -long: | - Alias for `docker image rm`. +long: Remove one or more images usage: docker rmi [OPTIONS] IMAGE [IMAGE...] pname: docker plink: docker.yaml @@ -13,3 +12,80 @@ options: - option: no-prune default_value: "false" description: Do not delete untagged parents +examples: |- + You can remove an image using its short or long ID, its tag, or its digest. If + an image has one or more tag 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 + + Untagged: test1:latest + + $ docker rmi test2 + + 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 + + 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 + ``` + diff --git a/_data/engine-cli/docker_run.yaml b/_data/engine-cli/docker_run.yaml index 56991bf1eb..fd197f1995 100644 --- a/_data/engine-cli/docker_run.yaml +++ b/_data/engine-cli/docker_run.yaml @@ -1,6 +1,17 @@ command: docker run short: Run a command in a new container -long: 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/engine/userguide/networking/). usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...] pname: docker plink: docker.yaml @@ -69,6 +80,9 @@ options: - option: device default_value: '[]' description: Add a host device to the container +- option: device-cgroup-rule + default_value: '[]' + description: Add a rule to the cgroup allowed devices list - option: device-read-bps default_value: '[]' description: Limit read rate (bytes per second) from a device @@ -114,13 +128,13 @@ options: - option: health-cmd description: Command to run to check health - option: health-interval - default_value: "0" + default_value: 0s description: Time between running the check (ns|us|ms|s|m|h) (default 0s) - option: health-retries default_value: "0" description: Consecutive failures needed to report unhealthy - option: health-timeout - default_value: "0" + default_value: 0s description: | Maximum time to allow one check to run (ns|us|ms|s|m|h) (default 0s) - option: help @@ -240,7 +254,8 @@ options: default_value: '[]' description: Security Options - option: shm-size - description: Size of /dev/shm, default value is 64MB + default_value: "0" + description: Size of /dev/shm - option: sig-proxy default_value: "true" description: Proxy received signals to the process @@ -285,3 +300,624 @@ options: - option: workdir shorthand: w description: Working directory inside the container +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 then 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/installation/binaries/#/get-the-linux-binary)), + 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/engine/tutorials/dockervolumes/) + + ### Publish or expose port (-p, --expose) + + ```bash + $ docker run -p 127.0.0.1:80:8080 ubuntu bash + ``` + + This binds port `8080` of the container to port `80` on `127.0.0.1` of the host + machine. The [Docker User + Guide](https://docs.docker.com/engine/userguide/networking/default_network/dockerlinks/) + explains in detail how to manipulate ports in Docker. + + ```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 + ``` + + This sets simple (non-array) environmental variables in the container. For + illustration all three + flags are shown here. Where `-e`, `--env` take an environment variable and + value, or if no `=` is provided, then that variable's current value, set via + `export`, is passed through (i.e. `$MYVAR1` from the host is set to `$MYVAR1` + in the container). When no `=` is provided and that variable is not defined + in the client's environment then that variable will be removed from the + container's list of environment variables. All three flags, `-e`, `--env` and + `--env-file` can be repeated. + + Regardless of the order of these three flags, the `--env-file` are processed + first, and then `-e`, `--env` flags. This way, the `-e` or `--env` will + override variables as needed. + + ```bash + $ cat ./env.list + TEST_FOO=BAR + $ docker run --env TEST_FOO="This is a test" --env-file ./env.list busybox env | grep TEST_FOO + TEST_FOO=This is a test + ``` + + The `--env-file` flag takes a filename as an argument and expects each line + to be in the `VAR=VAL` format, mimicking the argument passed to `--env`. Comment + lines need only be prefixed with `#` + + An example of a file passed with `--env-file` + + ```bash + $ cat ./env.list + TEST_FOO=BAR + + # this is a comment + TEST_APP_DEST_HOST=10.10.0.127 + TEST_APP_DEST_PORT=8888 + _TEST_BAR=FOO + TEST_APP_42=magic + helloWorld=true + 123qwe=bar + org.spring.config=something + + # pass through this variable from the caller + TEST_PASSTHROUGH + $ TEST_PASSTHROUGH=howdy docker run --env-file ./env.list busybox env + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + HOSTNAME=5198e0745561 + TEST_FOO=BAR + TEST_APP_DEST_HOST=10.10.0.127 + TEST_APP_DEST_PORT=8888 + _TEST_BAR=FOO + TEST_APP_42=magic + helloWorld=true + TEST_PASSTHROUGH=howdy + HOME=/root + 123qwe=bar + org.spring.config=something + + $ docker run --env-file ./env.list busybox env + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + HOSTNAME=5198e0745561 + TEST_FOO=BAR + TEST_APP_DEST_HOST=10.10.0.127 + TEST_APP_DEST_PORT=8888 + _TEST_BAR=FOO + TEST_APP_42=magic + helloWorld=true + TEST_PASSTHROUGH= + HOME=/root + 123qwe=bar + org.spring.config=something + ``` + + ### 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: + + ```none + 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/engine/userguide/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 + {% raw %} + $ 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 + {% endraw %} + ``` + + 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**: `--device` cannot be safely used with ephemeral devices. Block devices + > that may be removed should not be added to untrusted containers with + > `--device`. + + ### 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. | + | `failure` | Restart only if the container exits with a non-zero exit status. Optionally, limit the number of restart retries the Docker daemon attempts. | + | `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 + {% raw %} + $ HOSTIP=`ip -4 addr show scope global dev eth0 | grep inet | awk '{print \$2}' | cut -d / -f 1` + $ docker run --add-host=docker:${HOSTIP} --rm -it debian + {% endraw %} + ``` + + 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` will be used + > for both values. If no `ulimits` are set, they will be inherited from + > the default `ulimits` set on the daemon. `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). | + | `hyperv` | Hyper-V hypervisor partition-based isolation. | + + The default isolation on Windows server operating systems is `process`. The default (and only supported) + isolation on Windows client operating systems is `hyperv`. An attempt to start a container on a client + operating system 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 + ``` + + ### 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`: + + ```none + 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 will not be allowed. + + - `Network Namespace`: + + Sysctls beginning with net.* + + If you use the `--network=host` option using these sysctls will not be allowed. + diff --git a/_data/engine-cli/docker_save.yaml b/_data/engine-cli/docker_save.yaml index ecf7234832..5f63798c2f 100644 --- a/_data/engine-cli/docker_save.yaml +++ b/_data/engine-cli/docker_save.yaml @@ -1,7 +1,9 @@ command: docker save short: Save one or more images to a tar archive (streamed to STDOUT by default) -long: | - Alias for `docker image save`. +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 @@ -9,3 +11,32 @@ options: - option: output shorthand: o description: Write to a file, instead of STDOUT +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 + ``` + + ### 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 + ``` + diff --git a/_data/engine-cli/docker_search.yaml b/_data/engine-cli/docker_search.yaml index 3308069f1a..90b39b767f 100644 --- a/_data/engine-cli/docker_search.yaml +++ b/_data/engine-cli/docker_search.yaml @@ -1,42 +1,12 @@ command: docker search short: Search the Docker Hub for images -long: | - Search Docker Hub for images that match the specified `TERM`. The table - of images returned displays the name, description (truncated by default), number - of stars awarded, whether the image is official, and whether it is automated. +long: |- + Search [Docker Hub](https://hub.docker.com) for images - *Note* - Search queries will only return up to 25 results + See [*Find Public Images on Docker Hub*](https://docs.docker.com/engine/tutorials/dockerrepos/#searching-for-images) for + more details on finding shared images from the command line. - ## Filter - - Filter output based on these conditions: - - stars= - - is-automated=(true|false) - - is-official=(true|false) - - # EXAMPLES - - ## Search Docker Hub for ranked images - - Search a registry for the term 'fedora' and only display those images - ranked 3 or higher: - - $ docker search --filter=stars=3 fedora - NAME DESCRIPTION STARS OFFICIAL AUTOMATED - mattdm/fedora A basic Fedora image corresponding roughly... 50 - fedora (Semi) Official Fedora base image. 38 - mattdm/fedora-small A small Fedora image on which to build. Co... 8 - goldmann/wildfly A WildFly application server running on a ... 3 [OK] - - ## Search Docker Hub for automated images - - Search Docker Hub for the term 'fedora' and only display automated images - ranked 1 or higher: - - $ docker search --filter=is-automated=true --filter=stars=1 fedora - NAME DESCRIPTION STARS OFFICIAL AUTOMATED - goldmann/wildfly A WildFly application server running on a ... 3 [OK] - tutum/fedora-20 Fedora 20 image with SSH access. For the r... 1 [OK] + > **Note**: Search queries return a maximum of 25 results. usage: docker search [OPTIONS] TERM pname: docker plink: docker.yaml @@ -57,3 +27,64 @@ options: shorthand: s default_value: "0" description: Only displays with at least x stars +examples: "### Search images by name\n\nThis example displays images with a name containing + 'busybox':\n\n```none\n$ docker search busybox\n\nNAME DESCRIPTION + \ STARS OFFICIAL AUTOMATED\nbusybox Busybox + base image. 316 [OK] \nprogrium/busybox + \ 50 [OK]\nradial/busyboxplus + \ Full-chain, Internet enabled, busybox made... 8 [OK]\nodise/busybox-python + \ 2 [OK]\nazukiapp/busybox + \ This image is meant to be used as the base... 2 [OK]\nofayau/busybox-jvm + \ Prepare busybox to install a 32 bits JVM. 1 [OK]\nshingonoide/archlinux-busybox + \ Arch Linux, a lightweight and flexible Lin... 1 [OK]\nodise/busybox-curl + \ 1 [OK]\nofayau/busybox-libc32 + \ Busybox with 32 bits (and 64 bits) libs 1 [OK]\npeelsky/zulu-openjdk-busybox + \ 1 [OK]\nskomma/busybox-data + \ Docker image suitable for data volume cont... 1 [OK]\nelektritter/busybox-teamspeak + \ Lightweight teamspeak3 container based on... 1 [OK]\nsocketplane/busybox + \ 1 [OK]\noveits/docker-nginx-busybox + \ This is a tiny NginX docker image based on... 0 [OK]\nggtools/busybox-ubuntu + \ Busybox ubuntu version with extra goodies 0 [OK]\nnikfoundas/busybox-confd + \ Minimal busybox based distribution of confd 0 [OK]\nopenshift/busybox-http-app + \ 0 [OK]\njllopis/busybox + \ 0 [OK]\nswyckoff/busybox + \ 0 [OK]\npowellquiring/busybox + \ 0 [OK]\nwilliamyeh/busybox-sh + \ Docker image for BusyBox's sh 0 [OK]\nsimplexsys/busybox-cli-powered + \ Docker busybox images, with a few often us... 0 [OK]\nfhisamoto/busybox-java + \ Busybox java 0 [OK]\nscottabernethy/busybox + \ 0 [OK]\nmarclop/busybox-solr\n```\n\n### + Display non-truncated description (--no-trunc)\n\nThis example displays images with + a name containing 'busybox',\nat least 3 stars and the description isn't truncated + in the output:\n\n```bash\n$ docker search --stars=3 --no-trunc busybox\nNAME DESCRIPTION + \ STARS + \ OFFICIAL AUTOMATED\nbusybox Busybox base image. 325 + \ [OK] \nprogrium/busybox 50 + \ [OK]\nradial/busyboxplus Full-chain, Internet enabled, busybox + made from scratch. Comes in git and cURL flavors. 8 [OK]\n```\n\n### + Limit search results (--limit)\n\nThe flag `--limit` is the maximum number of results + returned by a search. This value could\nbe in the range between 1 and 100. The default + value of `--limit` is 25.\n\n\n### Filtering\n\nThe filtering flag (`-f` or `--filter`) + format is a `key=value` pair. If there is more\nthan one filter, then pass multiple + flags (e.g. `--filter \"foo=bar\" --filter \"bif=baz\"`)\n\nThe currently supported + filters are:\n\n* stars (int - number of stars the image has)\n* is-automated (true|false) + - is the image automated or not\n* is-official (true|false) - is the image official + or not\n\n\n#### stars\n\nThis example displays images with a name containing 'busybox' + and at\nleast 3 stars:\n\n```bash\n$ docker search --filter stars=3 busybox\n\nNAME + \ DESCRIPTION STARS OFFICIAL + \ AUTOMATED\nbusybox Busybox base image. 325 + \ [OK] \nprogrium/busybox 50 + \ [OK]\nradial/busyboxplus Full-chain, Internet enabled, busybox + made... 8 [OK]\n```\n\n\n#### is-automated\n\nThis example + displays images with a name containing 'busybox'\nand are automated builds:\n\n```bash\n$ + docker search --filter is-automated busybox\n\nNAME DESCRIPTION + \ STARS OFFICIAL AUTOMATED\nprogrium/busybox + \ 50 [OK]\nradial/busyboxplus + \ Full-chain, Internet enabled, busybox made... 8 [OK]\n```\n\n#### + is-official\n\nThis example displays images with a name containing 'busybox', at + least\n3 stars and are official builds:\n\n```bash\n$ docker search --filter \"is-official=true\" + --filter \"stars=3\" busybox\n\nNAME DESCRIPTION STARS + \ OFFICIAL AUTOMATED\nprogrium/busybox 50 + \ [OK]\nradial/busyboxplus Full-chain, Internet enabled, busybox + made... 8 [OK]\n```" + diff --git a/_data/engine-cli/docker_secret.yaml b/_data/engine-cli/docker_secret.yaml index bad1030e0e..c2b4e24738 100644 --- a/_data/engine-cli/docker_secret.yaml +++ b/_data/engine-cli/docker_secret.yaml @@ -14,3 +14,4 @@ clink: - docker_secret_inspect.yaml - docker_secret_ls.yaml - docker_secret_rm.yaml + diff --git a/_data/engine-cli/docker_secret_create.yaml b/_data/engine-cli/docker_secret_create.yaml index 56ad1f7cbf..fc23f053d5 100644 --- a/_data/engine-cli/docker_secret_create.yaml +++ b/_data/engine-cli/docker_secret_create.yaml @@ -9,3 +9,4 @@ options: shorthand: l default_value: '[]' description: Secret labels + diff --git a/_data/engine-cli/docker_secret_inspect.yaml b/_data/engine-cli/docker_secret_inspect.yaml index 6465702231..9cfbbf8f78 100644 --- a/_data/engine-cli/docker_secret_inspect.yaml +++ b/_data/engine-cli/docker_secret_inspect.yaml @@ -8,3 +8,4 @@ options: - option: format shorthand: f description: Format the output using the given Go template + diff --git a/_data/engine-cli/docker_secret_ls.yaml b/_data/engine-cli/docker_secret_ls.yaml index 8d4e44d1a0..0f8d3eb9ea 100644 --- a/_data/engine-cli/docker_secret_ls.yaml +++ b/_data/engine-cli/docker_secret_ls.yaml @@ -10,3 +10,4 @@ options: shorthand: q default_value: "false" description: Only display IDs + diff --git a/_data/engine-cli/docker_secret_rm.yaml b/_data/engine-cli/docker_secret_rm.yaml index 6965c2ffda..af14ff1715 100644 --- a/_data/engine-cli/docker_secret_rm.yaml +++ b/_data/engine-cli/docker_secret_rm.yaml @@ -5,3 +5,4 @@ long: Remove one or more secrets usage: docker secret rm SECRET [SECRET...] pname: docker secret plink: docker_secret.yaml + diff --git a/_data/engine-cli/docker_service.yaml b/_data/engine-cli/docker_service.yaml index 9e919b0fc8..792d1111e8 100644 --- a/_data/engine-cli/docker_service.yaml +++ b/_data/engine-cli/docker_service.yaml @@ -22,3 +22,4 @@ clink: - docker_service_rm.yaml - docker_service_scale.yaml - docker_service_update.yaml + diff --git a/_data/engine-cli/docker_service_create.yaml b/_data/engine-cli/docker_service_create.yaml index c9258efed3..a6c38299a6 100644 --- a/_data/engine-cli/docker_service_create.yaml +++ b/_data/engine-cli/docker_service_create.yaml @@ -21,6 +21,7 @@ options: default_value: '[]' description: Set custom DNS search domains - option: endpoint-mode + default_value: vip description: Endpoint mode (vip or dnsrr) - option: env shorthand: e @@ -54,7 +55,7 @@ options: default_value: "0.000" description: Limit CPUs - option: limit-memory - default_value: 0 B + default_value: "0" description: Limit Memory - option: log-driver description: Logging driver for service @@ -77,13 +78,16 @@ options: - option: publish shorthand: p description: Publish a port as a node port +- option: read-only + default_value: "false" + description: Mount the container's root filesystem as read only - option: replicas description: Number of tasks - option: reserve-cpu default_value: "0.000" description: Reserve CPUs - option: reserve-memory - default_value: 0 B + default_value: "0" description: Reserve Memory - option: restart-condition description: Restart when condition is met (none, on-failure, or any) @@ -103,7 +107,7 @@ options: default_value: "false" description: Allocate a pseudo-TTY - option: update-delay - default_value: "0" + default_value: 0s description: Delay between updates (ns|us|ms|s|m|h) (default 0s) - option: update-failure-action default_value: pause @@ -112,7 +116,7 @@ options: default_value: "0" description: Failure rate to tolerate during an update - option: update-monitor - default_value: "0" + default_value: 0s description: | Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s) - option: update-parallelism @@ -128,3 +132,4 @@ options: - option: workdir shorthand: w description: Working directory inside the container + diff --git a/_data/engine-cli/docker_service_inspect.yaml b/_data/engine-cli/docker_service_inspect.yaml index 05a9378687..f123e68040 100644 --- a/_data/engine-cli/docker_service_inspect.yaml +++ b/_data/engine-cli/docker_service_inspect.yaml @@ -11,3 +11,4 @@ options: - option: pretty default_value: "false" description: Print the information in a human friendly format. + diff --git a/_data/engine-cli/docker_service_logs.yaml b/_data/engine-cli/docker_service_logs.yaml index adbacd1a4b..5fab2466da 100644 --- a/_data/engine-cli/docker_service_logs.yaml +++ b/_data/engine-cli/docker_service_logs.yaml @@ -24,3 +24,4 @@ options: shorthand: t default_value: "false" description: Show timestamps + diff --git a/_data/engine-cli/docker_service_ls.yaml b/_data/engine-cli/docker_service_ls.yaml index cfdd0504ff..02785abdd4 100644 --- a/_data/engine-cli/docker_service_ls.yaml +++ b/_data/engine-cli/docker_service_ls.yaml @@ -9,7 +9,10 @@ options: - option: filter shorthand: f description: Filter output based on conditions provided +- option: format + description: Pretty-print services using a Go template - option: quiet shorthand: q default_value: "false" description: Only display IDs + diff --git a/_data/engine-cli/docker_service_ps.yaml b/_data/engine-cli/docker_service_ps.yaml index b47b0c5ad8..d5511cddbb 100644 --- a/_data/engine-cli/docker_service_ps.yaml +++ b/_data/engine-cli/docker_service_ps.yaml @@ -18,3 +18,4 @@ options: shorthand: q default_value: "false" description: Only display task IDs + diff --git a/_data/engine-cli/docker_service_rm.yaml b/_data/engine-cli/docker_service_rm.yaml index 94d27f91fb..152e93b138 100644 --- a/_data/engine-cli/docker_service_rm.yaml +++ b/_data/engine-cli/docker_service_rm.yaml @@ -5,3 +5,4 @@ long: Remove one or more services usage: docker service rm SERVICE [SERVICE...] pname: docker service plink: docker_service.yaml + diff --git a/_data/engine-cli/docker_service_scale.yaml b/_data/engine-cli/docker_service_scale.yaml index aa54631225..521eadc195 100644 --- a/_data/engine-cli/docker_service_scale.yaml +++ b/_data/engine-cli/docker_service_scale.yaml @@ -4,3 +4,4 @@ long: Scale one or multiple replicated services usage: docker service scale SERVICE=REPLICAS [SERVICE=REPLICAS...] pname: docker service plink: docker_service.yaml + diff --git a/_data/engine-cli/docker_service_update.yaml b/_data/engine-cli/docker_service_update.yaml index a33e099188..ca40587102 100644 --- a/_data/engine-cli/docker_service_update.yaml +++ b/_data/engine-cli/docker_service_update.yaml @@ -38,6 +38,7 @@ options: default_value: '[]' description: Remove a DNS search domain - option: endpoint-mode + default_value: vip description: Endpoint mode (vip or dnsrr) - option: env-add default_value: '[]' @@ -84,7 +85,7 @@ options: default_value: "0.000" description: Limit CPUs - option: limit-memory - default_value: 0 B + default_value: "0" description: Limit Memory - option: log-driver description: Logging driver for service @@ -103,13 +104,16 @@ options: description: Add or update a published port - option: publish-rm description: Remove a published port by its target port +- option: read-only + default_value: "false" + description: Mount the container's root filesystem as read only - option: replicas description: Number of tasks - option: reserve-cpu default_value: "0.000" description: Reserve CPUs - option: reserve-memory - default_value: 0 B + default_value: "0" description: Reserve Memory - option: restart-condition description: Restart when condition is met (none, on-failure, or any) @@ -135,7 +139,7 @@ options: default_value: "false" description: Allocate a pseudo-TTY - option: update-delay - default_value: "0" + default_value: 0s description: Delay between updates (ns|us|ms|s|m|h) (default 0s) - option: update-failure-action default_value: pause @@ -144,7 +148,7 @@ options: default_value: "0" description: Failure rate to tolerate during an update - option: update-monitor - default_value: "0" + default_value: 0s description: | Duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 0s) - option: update-parallelism @@ -160,3 +164,4 @@ options: - option: workdir shorthand: w description: Working directory inside the container + diff --git a/_data/engine-cli/docker_stack.yaml b/_data/engine-cli/docker_stack.yaml index 59f04a610d..7e40b31178 100644 --- a/_data/engine-cli/docker_stack.yaml +++ b/_data/engine-cli/docker_stack.yaml @@ -16,3 +16,4 @@ clink: - docker_stack_ps.yaml - docker_stack_rm.yaml - docker_stack_services.yaml + diff --git a/_data/engine-cli/docker_stack_deploy.yaml b/_data/engine-cli/docker_stack_deploy.yaml index 55453223f9..000f562217 100644 --- a/_data/engine-cli/docker_stack_deploy.yaml +++ b/_data/engine-cli/docker_stack_deploy.yaml @@ -14,3 +14,4 @@ options: - option: with-registry-auth default_value: "false" description: Send registry authentication details to Swarm agents + diff --git a/_data/engine-cli/docker_stack_ls.yaml b/_data/engine-cli/docker_stack_ls.yaml index 6d55173033..a71b379749 100644 --- a/_data/engine-cli/docker_stack_ls.yaml +++ b/_data/engine-cli/docker_stack_ls.yaml @@ -5,3 +5,4 @@ long: List stacks usage: docker stack ls pname: docker stack plink: docker_stack.yaml + diff --git a/_data/engine-cli/docker_stack_ps.yaml b/_data/engine-cli/docker_stack_ps.yaml index f11212a1bc..02695ca28c 100644 --- a/_data/engine-cli/docker_stack_ps.yaml +++ b/_data/engine-cli/docker_stack_ps.yaml @@ -14,3 +14,4 @@ options: - option: no-trunc default_value: "false" description: Do not truncate output + diff --git a/_data/engine-cli/docker_stack_rm.yaml b/_data/engine-cli/docker_stack_rm.yaml index 3ac9df3662..2fbac374dc 100644 --- a/_data/engine-cli/docker_stack_rm.yaml +++ b/_data/engine-cli/docker_stack_rm.yaml @@ -5,3 +5,4 @@ long: Remove the stack usage: docker stack rm STACK pname: docker stack plink: docker_stack.yaml + diff --git a/_data/engine-cli/docker_stack_services.yaml b/_data/engine-cli/docker_stack_services.yaml index 40f2462815..b07b97bde3 100644 --- a/_data/engine-cli/docker_stack_services.yaml +++ b/_data/engine-cli/docker_stack_services.yaml @@ -8,7 +8,10 @@ options: - option: filter shorthand: f description: Filter output based on conditions provided +- option: format + description: Pretty-print services using a Go template - option: quiet shorthand: q default_value: "false" description: Only display IDs + diff --git a/_data/engine-cli/docker_start.yaml b/_data/engine-cli/docker_start.yaml index 11b3588275..d75b08b6d6 100644 --- a/_data/engine-cli/docker_start.yaml +++ b/_data/engine-cli/docker_start.yaml @@ -1,7 +1,6 @@ command: docker start short: Start one or more stopped containers -long: | - Alias for `docker container start`. +long: Start one or more stopped containers usage: docker start [OPTIONS] CONTAINER [CONTAINER...] pname: docker plink: docker.yaml @@ -20,3 +19,8 @@ options: shorthand: i default_value: "false" description: Attach container's STDIN +examples: |- + ```bash + $ docker start my_container + ``` + diff --git a/_data/engine-cli/docker_stats.yaml b/_data/engine-cli/docker_stats.yaml index 84000076a3..d8009ef45e 100644 --- a/_data/engine-cli/docker_stats.yaml +++ b/_data/engine-cli/docker_stats.yaml @@ -1,7 +1,9 @@ command: docker stats short: Display a live stream of container(s) resource usage statistics -long: | - Alias for `docker container stats`. +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 want more detailed information about a container's resource usage, use the `/containers/(id)/stats` API endpoint. usage: docker stats [OPTIONS] [CONTAINER...] pname: docker plink: docker.yaml @@ -15,3 +17,99 @@ options: - option: no-stream default_value: "false" description: Disable streaming stats and only pull the first result +examples: |- + Running `docker stats` on all running containers against a Linux daemon. + + ```bash + $ docker stats + CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O + 1285939c1fd3 0.07% 796 KiB / 64 MiB 1.21% 788 B / 648 B 3.568 MB / 512 KB + 9c76f7834ae2 0.07% 2.746 MiB / 64 MiB 4.29% 1.266 KB / 648 B 12.4 MB / 0 B + d1ea048f04e4 0.03% 4.583 MiB / 64 MiB 6.30% 2.854 KB / 648 B 27.7 MB / 0 B + ``` + + Running `docker stats` on multiple containers by name and id against a Linux daemon. + + ```bash + $ docker stats fervent_panini 5acfcb1b4fd1 + CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O + 5acfcb1b4fd1 0.00% 115.2 MiB/1.045 GiB 11.03% 1.422 kB/648 B + fervent_panini 0.02% 11.08 MiB/1.045 GiB 1.06% 648 B/648 B + ``` + + Running `docker stats` on all running containers against a Windows daemon. + + ```powershell + PS E:\> docker stats + CONTAINER 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 IMAGE COMMAND CREATED STATUS PORTS NAMES + 3f214c61ad1d nanoserver "cmd" 2 minutes ago Up 2 minutes big_minsky + 9db7aa4d986d windowsservercore "cmd" 2 minutes ago Up 2 minutes mad_wilson + 09d3bb5b1604 windowsservercore "cmd" 2 minutes ago Up 2 minutes affectionate_easley + + PS E:\> docker stats 3f214c61ad1d mad_wilson + CONTAINER CPU % PRIV WORKING SET NET I/O BLOCK I/O + 3f214c61ad1d 0.00% 46.25 MiB 76.3 kB / 7.92 kB 10.3 MB / 14.7 MB + 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 + {% raw %} + $ docker stats --format "{{.Container}}: {{.CPUPerc}}" + + 09d3bb5b1604: 6.61% + 9db7aa4d986d: 9.19% + 3f214c61ad1d: 0.00% + {% endraw %} + ``` + + To list all containers statistics with their name, CPU percentage and memory + usage in a table format you can use: + + ```bash + {% raw %} + $ 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 + {% endraw %} + ``` + diff --git a/_data/engine-cli/docker_stop.yaml b/_data/engine-cli/docker_stop.yaml index 0f0dcde4c9..c650227858 100644 --- a/_data/engine-cli/docker_stop.yaml +++ b/_data/engine-cli/docker_stop.yaml @@ -1,7 +1,8 @@ command: docker stop short: Stop one or more running containers -long: | - Alias for `docker container stop`. +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 @@ -10,3 +11,8 @@ options: shorthand: t default_value: "10" description: Seconds to wait for stop before killing it +examples: |- + ```bash + $ docker stop my_container + ``` + diff --git a/_data/engine-cli/docker_swarm.yaml b/_data/engine-cli/docker_swarm.yaml index b8935bd230..eb05ffc45b 100644 --- a/_data/engine-cli/docker_swarm.yaml +++ b/_data/engine-cli/docker_swarm.yaml @@ -20,3 +20,4 @@ clink: - docker_swarm_unlock.yaml - docker_swarm_unlock-key.yaml - docker_swarm_update.yaml + diff --git a/_data/engine-cli/docker_swarm_init.yaml b/_data/engine-cli/docker_swarm_init.yaml index 80833bf1d2..6734b0e2ca 100644 --- a/_data/engine-cli/docker_swarm_init.yaml +++ b/_data/engine-cli/docker_swarm_init.yaml @@ -37,3 +37,4 @@ options: - option: task-history-limit default_value: "5" description: Task history retention limit + diff --git a/_data/engine-cli/docker_swarm_join-token.yaml b/_data/engine-cli/docker_swarm_join-token.yaml index a334eb1dd7..326572db1c 100644 --- a/_data/engine-cli/docker_swarm_join-token.yaml +++ b/_data/engine-cli/docker_swarm_join-token.yaml @@ -12,3 +12,4 @@ options: - option: rotate default_value: "false" description: Rotate join token + diff --git a/_data/engine-cli/docker_swarm_join.yaml b/_data/engine-cli/docker_swarm_join.yaml index 22e5781368..d82a2fe3b4 100644 --- a/_data/engine-cli/docker_swarm_join.yaml +++ b/_data/engine-cli/docker_swarm_join.yaml @@ -15,3 +15,4 @@ options: description: 'Listen address (format: [:port])' - option: token description: Token for entry into the swarm + diff --git a/_data/engine-cli/docker_swarm_leave.yaml b/_data/engine-cli/docker_swarm_leave.yaml index d22cbd21b5..d91b7a97e9 100644 --- a/_data/engine-cli/docker_swarm_leave.yaml +++ b/_data/engine-cli/docker_swarm_leave.yaml @@ -9,3 +9,4 @@ options: shorthand: f default_value: "false" description: Force this node to leave the swarm, ignoring warnings + diff --git a/_data/engine-cli/docker_swarm_unlock-key.yaml b/_data/engine-cli/docker_swarm_unlock-key.yaml index a5534d60a8..38f93daf1b 100644 --- a/_data/engine-cli/docker_swarm_unlock-key.yaml +++ b/_data/engine-cli/docker_swarm_unlock-key.yaml @@ -12,3 +12,4 @@ options: - option: rotate default_value: "false" description: Rotate unlock key + diff --git a/_data/engine-cli/docker_swarm_unlock.yaml b/_data/engine-cli/docker_swarm_unlock.yaml index 5155a4961b..4dd73c8c15 100644 --- a/_data/engine-cli/docker_swarm_unlock.yaml +++ b/_data/engine-cli/docker_swarm_unlock.yaml @@ -4,3 +4,4 @@ long: Unlock swarm usage: docker swarm unlock pname: docker swarm plink: docker_swarm.yaml + diff --git a/_data/engine-cli/docker_swarm_update.yaml b/_data/engine-cli/docker_swarm_update.yaml index 0380cb850e..233d1715c2 100644 --- a/_data/engine-cli/docker_swarm_update.yaml +++ b/_data/engine-cli/docker_swarm_update.yaml @@ -25,3 +25,4 @@ options: - option: task-history-limit default_value: "5" description: Task history retention limit + diff --git a/_data/engine-cli/docker_system.yaml b/_data/engine-cli/docker_system.yaml index 9b3a9fa724..4a4de17d27 100644 --- a/_data/engine-cli/docker_system.yaml +++ b/_data/engine-cli/docker_system.yaml @@ -14,3 +14,4 @@ clink: - docker_system_events.yaml - docker_system_info.yaml - docker_system_prune.yaml + diff --git a/_data/engine-cli/docker_system_df.yaml b/_data/engine-cli/docker_system_df.yaml index bef13871a4..66c3678756 100644 --- a/_data/engine-cli/docker_system_df.yaml +++ b/_data/engine-cli/docker_system_df.yaml @@ -9,3 +9,4 @@ options: shorthand: v default_value: "false" description: Show detailed information on space usage + diff --git a/_data/engine-cli/docker_system_events.yaml b/_data/engine-cli/docker_system_events.yaml index dba0ddafa7..38325b6162 100644 --- a/_data/engine-cli/docker_system_events.yaml +++ b/_data/engine-cli/docker_system_events.yaml @@ -1,140 +1,6 @@ command: docker system events short: Get real time events from the server -long: |+ - Get event information from the Docker daemon. Information can include historical - information and real-time information. - - Docker containers will report the following events: - - attach, commit, copy, create, destroy, detach, die, exec_create, exec_detach, exec_start, export, kill, oom, pause, rename, resize, restart, start, stop, top, unpause, update - - Docker images report the following events: - - delete, import, load, pull, push, save, tag, untag - - Docker volumes report the following events: - - create, mount, unmount, destroy - - Docker networks report the following events: - - create, connect, disconnect, destroy - - # OPTIONS - - 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. - - # EXAMPLES - - ## Listening for Docker events - - After running docker events a container 786d698004576 is started and stopped - (The container name has been shortened in the output below): - - # docker events - 2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) start - 2015-01-28T20:21:31.000000000-08:00 59211849bc10: (from whenry/testimage:latest) die - 2015-01-28T20:21:32.000000000-08:00 59211849bc10: (from whenry/testimage:latest) stop - - ## Listening for events since a given date - Again the output container IDs have been shortened for the purposes of this document: - - # docker events --since '2015-01-28' - 2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create - 2015-01-28T20:25:38.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start - 2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) create - 2015-01-28T20:25:39.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start - 2015-01-28T20:25:40.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die - 2015-01-28T20:25:42.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop - 2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) start - 2015-01-28T20:25:45.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) die - 2015-01-28T20:25:46.000000000-08:00 c21f6c22ba27: (from whenry/testimage:latest) stop - - The following example outputs all events that were generated in the last 3 minutes, - relative to the current time on the client machine: - - # docker events --since '3m' - 2015-05-12T11:51:30.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) die - 2015-05-12T15:52:12.999999999Z07:00 4386fb97867d: (from ubuntu-1:14.04) stop - 2015-05-12T15:53:45.999999999Z07:00 7805c1d35632: (from redis:2.8) die - 2015-05-12T15:54:03.999999999Z07:00 7805c1d35632: (from redis:2.8) stop - - If you do not provide the --since option, the command returns only new and/or - live events. - - ## Format - - If a format (`--format`) is specified, the given template will be executed - instead of the default format. Go's **text/template** package describes all the - details of the format. - - # 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 - - 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/ . - - # 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.. - - ## Filters - - $ docker events --filter 'event=stop' - 2014-05-10T17:42:14.999999999Z07:00 container stop 4386fb97867d (image=ubuntu-1:14.04) - 2014-09-03T17:42:14.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) - - $ docker events --filter 'image=ubuntu-1:14.04' - 2014-05-10T17:42:14.999999999Z07:00 container start 4386fb97867d (image=ubuntu-1:14.04) - 2014-05-10T17:42:14.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) - - $ docker events --filter 'container=7805c1d35632' - 2014-05-10T17:42:14.999999999Z07:00 container die 7805c1d35632 (image=redis:2.8) - 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image= redis:2.8) - - $ docker events --filter 'container=7805c1d35632' --filter 'container=4386fb97867d' - 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 (image=redis:2.8) - 2014-09-03T15:49:29.999999999Z07:00 container stop 7805c1d35632 (image=redis:2.8) - - $ docker events --filter 'container=7805c1d35632' --filter 'event=stop' - 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' (experimental) - 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) - +long: Get real time events from the server usage: docker system events [OPTIONS] pname: docker system plink: docker_system.yaml @@ -148,3 +14,4 @@ options: description: Show all events created since timestamp - option: until description: Stream events until this timestamp + diff --git a/_data/engine-cli/docker_system_info.yaml b/_data/engine-cli/docker_system_info.yaml index 14d83c2e4d..1c01d7c47d 100644 --- a/_data/engine-cli/docker_system_info.yaml +++ b/_data/engine-cli/docker_system_info.yaml @@ -1,68 +1,6 @@ command: docker system info short: Display system-wide information -long: "This command displays system wide information regarding the Docker installation.\nInformation - displayed includes the kernel version, number of containers and images.\nThe number - of images shown is the number of unique images. The same image tagged\nunder different - names is counted only once.\n\nIf a format is specified, the given template will - be executed instead of the\ndefault format. Go's **text/template** package\ndescribes - all the details of the format.\n\nDepending on the storage driver in use, additional - information can be shown, such\nas pool name, data file, metadata file, data space - used, total data space, metadata\nspace used, and total metadata space.\n\nThe data - file is where the images are stored and the metadata file is where the\nmeta data - regarding those images are stored. When run for the first time Docker\nallocates - a certain amount of data space and meta data space from the space\navailable on - the volume where `/var/lib/docker` is mounted.\n\n# EXAMPLES\n\n## Display Docker - system information\n\nHere is a sample output for a daemon running on Ubuntu, using - the overlay2\nstorage driver:\n\n $ docker -D info\n Containers: 14\n Running: - 3\n Paused: 1\n Stopped: 10\n Images: 52\n Server Version: 1.13.0\n - \ Storage Driver: overlay2\n Backing Filesystem: extfs\n Supports d_type: - true\n Native Overlay Diff: false\n Logging Driver: json-file\n Cgroup - Driver: cgroupfs\n Plugins:\n Volume: local\n Network: bridge host macvlan - null overlay\n Swarm: active\n NodeID: rdjq45w1op418waxlairloqbm\n Is - Manager: true\n ClusterID: te8kdyw33n36fqiz74bfjeixd\n Managers: 1\n Nodes: - 2\n Orchestration:\n Task History Retention Limit: 5\n Raft:\n Snapshot - Interval: 10000\n Number of Old Snapshots to Retain: 0\n Heartbeat Tick: - 1\n Election Tick: 3\n Dispatcher:\n Heartbeat Period: 5 seconds\n - \ CA Configuration:\n Expiry Duration: 3 months\n Node Address: 172.16.66.128 - 172.16.66.129\n Manager Addresses:\n 172.16.66.128:2477\n Runtimes: - runc\n Default Runtime: runc\n Init Binary: docker-init\n containerd version: - 8517738ba4b82aff5662c97ca4627e7e4d03b531\n runc version: ac031b5bf1cc92239461125f4c1ffb760522bbf2\n - \ init version: N/A (expected: v0.13.0)\n Security Options:\n apparmor\n - \ seccomp\n Profile: default\n Kernel Version: 4.4.0-31-generic\n Operating - System: Ubuntu 16.04.1 LTS\n OSType: linux\n Architecture: x86_64\n CPUs: - 2\n Total Memory: 1.937 GiB\n Name: ubuntu\n ID: H52R:7ZR6:EIIA:76JG:ORIY:BVKF:GSFU:HNPG:B5MK:APSC:SZ3Q:N326\n - \ Docker Root Dir: /var/lib/docker\n Debug Mode (client): true\n Debug Mode - (server): true\n File Descriptors: 30\n Goroutines: 123\n System Time: - 2016-11-12T17:24:37.955404361-08:00\n EventsListeners: 0\n Http Proxy: http://test:test@proxy.example.com:8080\n - \ Https Proxy: https://test:test@proxy.example.com:8080\n No Proxy: localhost,127.0.0.1,docker-registry.somecorporation.com\n - \ Registry: https://index.docker.io/v1/\n WARNING: No swap limit support\n - \ Labels:\n storage=ssd\n staging=true\n Experimental: false\n Insecure - Registries:\n 127.0.0.0/8\n Registry Mirrors:\n http://192.168.1.2/\n - \ http://registry-mirror.example.com:5000/\n Live Restore Enabled: false\n\n\n\nThe - global `-D` option tells all `docker` commands to output debug information.\n\nThe - example below shows the output for a daemon running on Red Hat Enterprise Linux,\nusing - the devicemapper storage driver. As can be seen in the output, additional\ninformation - about the devicemapper storage driver is shown:\n\n $ docker info\n Containers: - 14\n Running: 3\n Paused: 1\n Stopped: 10\n Untagged Images: 52\n - \ Server Version: 1.10.3\n Storage Driver: devicemapper\n Pool Name: docker-202:2-25583803-pool\n - \ Pool Blocksize: 65.54 kB\n Base Device Size: 10.74 GB\n Backing Filesystem: - xfs\n Data file: /dev/loop0\n Metadata file: /dev/loop1\n Data Space - Used: 1.68 GB\n Data Space Total: 107.4 GB\n Data Space Available: 7.548 - GB\n Metadata Space Used: 2.322 MB\n Metadata Space Total: 2.147 GB\n Metadata - Space Available: 2.145 GB\n Udev Sync Supported: true\n Deferred Removal - Enabled: false\n Deferred Deletion Enabled: false\n Deferred Deleted Device - Count: 0\n Data loop file: /var/lib/docker/devicemapper/devicemapper/data\n - \ Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata\n Library - Version: 1.02.107-RHEL7 (2015-12-01)\n Execution Driver: native-0.2\n Logging - Driver: json-file\n Plugins:\n Volume: local\n Network: null host bridge\n - \ Kernel Version: 3.10.0-327.el7.x86_64\n Operating System: Red Hat Enterprise - Linux Server 7.2 (Maipo)\n OSType: linux\n Architecture: x86_64\n CPUs: - 1\n Total Memory: 991.7 MiB\n Name: ip-172-30-0-91.ec2.internal\n ID: I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S\n - \ Docker Root Dir: /var/lib/docker\n Debug mode (client): false\n Debug - mode (server): false\n Username: gordontheturtle\n Registry: https://index.docker.io/v1/\n - \ Insecure registries:\n myinsecurehost:5000\n 127.0.0.0/8\n\nYou can - also specify the output format:\n\n $ docker info --format '{{json .}}'\n\t{\"ID\":\"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S\",\"Containers\":14, - ...}\n" +long: Display system-wide information usage: docker system info [OPTIONS] pname: docker system plink: docker_system.yaml @@ -70,3 +8,4 @@ options: - option: format shorthand: f description: Format the output using the given Go template + diff --git a/_data/engine-cli/docker_system_prune.yaml b/_data/engine-cli/docker_system_prune.yaml index 983c74bd81..009bf7c84c 100644 --- a/_data/engine-cli/docker_system_prune.yaml +++ b/_data/engine-cli/docker_system_prune.yaml @@ -15,3 +15,4 @@ options: shorthand: f default_value: "false" description: Do not prompt for confirmation + diff --git a/_data/engine-cli/docker_tag.yaml b/_data/engine-cli/docker_tag.yaml index c7449f7467..e8554a7260 100644 --- a/_data/engine-cli/docker_tag.yaml +++ b/_data/engine-cli/docker_tag.yaml @@ -1,7 +1,61 @@ command: docker tag short: Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE -long: | - Alias for `docker image tag`. +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 via Repositories*](https://docs.docker.com/engine/tutorials/dockerrepos/#/contributing-to-docker-hub). 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 + ``` + diff --git a/_data/engine-cli/docker_top.yaml b/_data/engine-cli/docker_top.yaml index c2fcf45fb6..c4cda8bb6e 100644 --- a/_data/engine-cli/docker_top.yaml +++ b/_data/engine-cli/docker_top.yaml @@ -1,7 +1,7 @@ command: docker top short: Display the running processes of a container -long: | - Alias for `docker container top`. +long: Display the running processes of a container usage: docker top CONTAINER [ps OPTIONS] pname: docker plink: docker.yaml + diff --git a/_data/engine-cli/docker_unpause.yaml b/_data/engine-cli/docker_unpause.yaml index 459f00b965..9ef98f1efb 100644 --- a/_data/engine-cli/docker_unpause.yaml +++ b/_data/engine-cli/docker_unpause.yaml @@ -1,7 +1,17 @@ command: docker unpause short: Unpause all processes within one or more containers -long: | - Alias for `docker container unpause`. +long: |- + The `docker unpause` command un-suspends all processes in the specified containers. + On Linux, it does this using the cgroups freezer. + + See the + [cgroups freezer 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 + ``` + diff --git a/_data/engine-cli/docker_update.yaml b/_data/engine-cli/docker_update.yaml index 2c5246d032..a0145d1869 100644 --- a/_data/engine-cli/docker_update.yaml +++ b/_data/engine-cli/docker_update.yaml @@ -1,7 +1,16 @@ command: docker update short: Update configuration of one or more containers -long: | - Alias for `docker container update`. +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. usage: docker update [OPTIONS] CONTAINER [CONTAINER...] pname: docker plink: docker.yaml @@ -42,3 +51,73 @@ options: Swap limit equal to memory plus swap: '-1' to enable unlimited swap - option: restart description: Restart policy to apply when a container exits +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. + diff --git a/_data/engine-cli/docker_version.yaml b/_data/engine-cli/docker_version.yaml index 61451ec84d..a1e6a46570 100644 --- a/_data/engine-cli/docker_version.yaml +++ b/_data/engine-cli/docker_version.yaml @@ -1,17 +1,11 @@ command: docker version short: Show the Docker version information -long: "This command displays version information for both the Docker client and \ndaemon. - \n\n# EXAMPLES\n\n## Display Docker version information\n\nThe default output:\n\n - \ $ docker version\n\tClient:\n\t Version: 1.8.0\n\t API version: 1.20\n\t - Go version: go1.4.2\n\t Git commit: f5bae0a\n\t Built: Tue Jun 23 17:56:00 - UTC 2015\n\t OS/Arch: linux/amd64\n\n\tServer:\n\t Version: 1.8.0\n\t - API version: 1.20\n\t Go version: go1.4.2\n\t Git commit: f5bae0a\n\t Built: - \ Tue Jun 23 17:56:00 UTC 2015\n\t OS/Arch: linux/amd64\n\nGet server - version:\n\n $ docker version --format '{{.Server.Version}}'\n\t1.8.0\n\nDump - raw data:\n\nTo view all available fields, you can use the format `{{json .}}`.\n\n - \ $ docker version --format '{{json .}}'\n {\"Client\":{\"Version\":\"1.8.0\",\"ApiVersion\":\"1.20\",\"GitCommit\":\"f5bae0a\",\"GoVersion\":\"go1.4.2\",\"Os\":\"linux\",\"Arch\":\"amd64\",\"BuildTime\":\"Tue - Jun 23 17:56:00 UTC 2015\"},\"ServerOK\":true,\"Server\":{\"Version\":\"1.8.0\",\"ApiVersion\":\"1.20\",\"GitCommit\":\"f5bae0a\",\"GoVersion\":\"go1.4.2\",\"Os\":\"linux\",\"Arch\":\"amd64\",\"KernelVersion\":\"3.13.2-gentoo\",\"BuildTime\":\"Tue - Jun 23 17:56:00 UTC 2015\"}}\n" +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 @@ -19,3 +13,46 @@ options: - option: format shorthand: f description: Format the output using the given Go template +examples: |- + ### Default output + + ```bash + $ docker version + + Client: + Version: 1.8.0 + API version: 1.20 + Go version: go1.4.2 + Git commit: f5bae0a + Built: Tue Jun 23 17:56:00 UTC 2015 + OS/Arch: linux/amd64 + + Server: + Version: 1.8.0 + API version: 1.20 + Go version: go1.4.2 + Git commit: f5bae0a + Built: Tue Jun 23 17:56:00 UTC 2015 + OS/Arch: linux/amd64 + ``` + + ### Get the server version + + ```bash + {% raw %} + $ docker version --format '{{.Server.Version}}' + + 1.8.0 + {% endraw %} + ``` + + ### Dump raw JSON data + + ```bash + {% raw %} + $ docker version --format '{{json .}}' + + {"Client":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"},"ServerOK":true,"Server":{"Version":"1.8.0","ApiVersion":"1.20","GitCommit":"f5bae0a","GoVersion":"go1.4.2","Os":"linux","Arch":"amd64","KernelVersion":"3.13.2-gentoo","BuildTime":"Tue Jun 23 17:56:00 UTC 2015"}} + {% endraw %} + ``` + diff --git a/_data/engine-cli/docker_volume.yaml b/_data/engine-cli/docker_volume.yaml index 62452db862..e011231085 100644 --- a/_data/engine-cli/docker_volume.yaml +++ b/_data/engine-cli/docker_volume.yaml @@ -1,20 +1,6 @@ command: docker volume short: Manage volumes -long: | - The `docker volume` command has subcommands for managing data volumes. A data - volume is a specially-designated directory that by-passes storage driver - management. - - Data volumes persist data independent of a container's life cycle. When you - delete a container, the Docker daemon does not delete any data volumes. You can - share volumes across multiple containers. Moreover, you can share data volumes - with other computing resources in your system. - - To see help for a subcommand, use: - - docker volume COMMAND --help - - For full details on using docker volume visit Docker's online documentation. +long: Manage volumes usage: docker volume COMMAND pname: docker plink: docker.yaml @@ -30,3 +16,4 @@ clink: - docker_volume_ls.yaml - docker_volume_prune.yaml - docker_volume_rm.yaml + diff --git a/_data/engine-cli/docker_volume_create.yaml b/_data/engine-cli/docker_volume_create.yaml index 4e81300989..f2cb648c19 100644 --- a/_data/engine-cli/docker_volume_create.yaml +++ b/_data/engine-cli/docker_volume_create.yaml @@ -1,41 +1,6 @@ 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. You create a volume and then - configure the container to use it, for example: - - $ docker volume create hello - hello - $ docker run -d -v hello:/world busybox ls /world - - The mount is created inside the container's `/src` directory. Docker doesn't - 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. - - ## Driver specific options - - Some volume drivers may take options to customize the volume creation. Use the - `-o` or `--opt` flags to pass driver options: - - $ docker volume create --driver fake --opt tardis=blue --opt timey=wimey - - 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: - - $ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 - - Another example: - - $ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 +long: Create a volume usage: docker volume create [OPTIONS] [VOLUME] pname: docker volume plink: docker_volume.yaml @@ -53,3 +18,4 @@ options: shorthand: o default_value: map[] description: Set driver specific options + diff --git a/_data/engine-cli/docker_volume_inspect.yaml b/_data/engine-cli/docker_volume_inspect.yaml index 4ab9a7c847..bd43d7f5c5 100644 --- a/_data/engine-cli/docker_volume_inspect.yaml +++ b/_data/engine-cli/docker_volume_inspect.yaml @@ -1,10 +1,6 @@ command: docker volume inspect short: Display detailed information on one or more volumes -long: | - Returns information about one or more volumes. By default, this command renders - all results in a JSON array. You can specify an alternate format to execute a - given template is executed for each result. Go's https://golang.org/pkg/text/template/ - package describes all the details of the format. +long: Display detailed information on one or more volumes usage: docker volume inspect [OPTIONS] VOLUME [VOLUME...] pname: docker volume plink: docker_volume.yaml @@ -12,3 +8,4 @@ options: - option: format shorthand: f description: Format the output using the given Go template + diff --git a/_data/engine-cli/docker_volume_ls.yaml b/_data/engine-cli/docker_volume_ls.yaml index 1db4629d36..ba9f14fb14 100644 --- a/_data/engine-cli/docker_volume_ls.yaml +++ b/_data/engine-cli/docker_volume_ls.yaml @@ -1,18 +1,7 @@ command: docker volume ls aliases: list short: List volumes -long: | - Lists all the volumes Docker manages. You can filter using the `-f` or - `--filter` flag. The filtering format is a `key=value` pair. To specify - more than one filter, pass multiple flags (for example, - `--filter "foo=bar" --filter "bif=baz"`) - - The currently supported filters are: - - * `dangling` (boolean - `true` or `false`, `1` or `0`) - * `driver` (a volume driver's name) - * `label` (`label=` or `label==`) - * `name` (a volume's name) +long: List volumes usage: docker volume ls [OPTIONS] pname: docker volume plink: docker_volume.yaml @@ -26,3 +15,4 @@ options: shorthand: q default_value: "false" description: Only display volume names + diff --git a/_data/engine-cli/docker_volume_prune.yaml b/_data/engine-cli/docker_volume_prune.yaml index e9facac497..41eea0915c 100644 --- a/_data/engine-cli/docker_volume_prune.yaml +++ b/_data/engine-cli/docker_volume_prune.yaml @@ -9,3 +9,4 @@ options: shorthand: f default_value: "false" description: Do not prompt for confirmation + diff --git a/_data/engine-cli/docker_volume_rm.yaml b/_data/engine-cli/docker_volume_rm.yaml index 832e2a90ae..8ad09f639b 100644 --- a/_data/engine-cli/docker_volume_rm.yaml +++ b/_data/engine-cli/docker_volume_rm.yaml @@ -12,7 +12,8 @@ options: shorthand: f default_value: "false" description: Force the removal of one or more volumes -example: |2 +examples: |2 $ docker volume rm hello hello + diff --git a/_data/engine-cli/docker_wait.yaml b/_data/engine-cli/docker_wait.yaml index 3cd44d1390..f550aa2fe4 100644 --- a/_data/engine-cli/docker_wait.yaml +++ b/_data/engine-cli/docker_wait.yaml @@ -1,7 +1,35 @@ command: docker wait short: Block until one or more containers stop, then print their exit codes -long: | - Alias for `docker container wait`. +long: Block until one or more containers stop, then print their exit codes usage: docker wait CONTAINER [CONTAINER...] pname: docker plink: docker.yaml +examples: |- + Start a container in the background. + + ```bash + $ docker run -dit --name=my_container ubuntu bash + ``` + + Run `docker wait`, which should block until the container exits. + + ```bash + $ docker wait my_container + ``` + + In another terminal, stop the first container. The `docker wait` command above + returns the exit code. + + ```bash + $ docker stop my_container + ``` + + This is the same `docker wait` command from above, but it now exits, returning + `0`. + + ```bash + $ docker wait my_container + + 0 + ``` + diff --git a/_data/staging-container/Dockerfile b/_data/staging-container/Dockerfile index a4e6b23078..8fdfe6ddb0 100644 --- a/_data/staging-container/Dockerfile +++ b/_data/staging-container/Dockerfile @@ -1,7 +1,7 @@ -FROM starefossen/github-pages:onbuild +FROM starefossen/github-pages:112 VOLUME /usr/src/app EXPOSE 4000 -CMD jekyll serve -d /_site --watch -H 0.0.0.0 -P 4000 \ No newline at end of file +CMD jekyll serve -d /_site --watch -H 0.0.0.0 -P 4000 diff --git a/_data/toc.yaml b/_data/toc.yaml index b193e7ea02..8f94f7b83b 100644 --- a/_data/toc.yaml +++ b/_data/toc.yaml @@ -20,9 +20,9 @@ guides: section: - path: /engine/installation/ title: Install Docker Engine - - path: /docker-for-mac/ + - path: /docker-for-mac/install/ title: Docker for Mac - - path: /docker-for-windows/ + - path: /docker-for-windows/install/ title: Docker for Windows - sectiontitle: Docker for Linux section: @@ -35,7 +35,7 @@ guides: - path: /engine/installation/linux/fedora/ title: Fedora - path: /engine/installation/linux/debian/ - title: Debian + title: Debian or Raspbian - path: /engine/installation/linux/oracle/ title: Oracle Linux - path: /engine/installation/linux/suse/ @@ -272,7 +272,7 @@ guides: title: Link via an ambassador container - sectiontitle: Troubleshoot Docker Engine section: - - path: /engine/admin/troubleshooting_volume_errors.md + - path: /engine/admin/troubleshooting_volume_errors/ title: Troubleshoot volume problems - sectiontitle: Manage a swarm section: @@ -318,7 +318,7 @@ guides: title: Deploy services to a swarm - path: /engine/swarm/secrets/ title: Manage sensitive data with Docker secrets - - path: /engine/swarm/swarm_manager_locking.md + - path: /engine/swarm/swarm_manager_locking/ title: Lock your swarm - path: /engine/swarm/networking/ title: Attach services to an overlay network @@ -460,6 +460,8 @@ guides: title: v1.10 - path: /v1.11 title: v1.11 + - path: /v1.12 + title: v1.12 reference: - title: Dockerfile reference @@ -476,7 +478,7 @@ reference: - title: Compose (docker-compose) CLI path: /compose/reference/overview/ nosync: true -- title: Daemon (dockerd) CLI +- title: Daemon CLI reference (dockerd) path: /engine/reference/commandline/dockerd/ - title: Docker ID Accounts API path: /docker-id/api-reference/ @@ -489,12 +491,14 @@ reference: title: Getting started - path: /engine/api/sdks/ title: SDKs - - path: /engine/api/v1.25/ - title: API 1.25 Reference + - path: /engine/api/v1.26/ + title: v1.26 Reference - sectiontitle: Previous API versions section: - path: /engine/api/version-history/ title: Version history overview + - path: /engine/api/v1.25/ + title: v1.25 reference - path: /engine/api/v1.24/ title: v1.24 reference - path: /engine/api/v1.23/ @@ -521,6 +525,18 @@ reference: title: docker attach - path: /engine/reference/commandline/build/ title: docker build + - sectiontitle: docker checkpoint * + section: + - path: /engine/reference/commandline/checkpoint/ + title: docker checkpoint + - path: /engine/reference/commandline/checkpoint_create/ + title: docker checkpoint create + - path: /engine/reference/commandline/checkpoint_create/ + title: docker checkpoint create + - path: /engine/reference/commandline/checkpoint_ls/ + title: docker checkpoint ls + - path: /engine/reference/commandline/checkpoint_rm/ + title: docker checkpoint rm - path: /engine/reference/commandline/commit/ title: docker commit - sectiontitle: docker container * @@ -770,7 +786,7 @@ reference: - path: /engine/reference/commandline/stop/ title: docker stop - sectiontitle: docker swarm * - setcion: + section: - path: /engine/reference/commandline/swarm/ title: docker swarm - path: /engine/reference/commandline/swarm_init/ @@ -818,7 +834,7 @@ reference: - path: /engine/reference/commandline/volume_ls/ title: docker volume ls - path: /engine/reference/commandline/volume_prune/ - title: docker volume ls + title: docker volume prune - path: /engine/reference/commandline/volume_rm/ title: docker volume rm - path: /engine/reference/commandline/wait/ @@ -830,13 +846,12 @@ reference: path: /registry/spec/api/ nosync: true - title: Trusted Registry API - path: /apidocs/overview/ + path: /datacenter/dtr/2.2/reference/api/ +- title: Trusted Registry CLI + path: /datacenter/dtr/2.2/reference/cli/ nosync: true -- title: Trusted Registry (docker/dtr) CLI - path: /datacenter/dtr/2.1/reference/cli/ - nosync: true -- title: UCP Tool (docker/ucp) CLI - path: /datacenter/ucp/2.0/reference/cli/ +- title: Universal Control Plane CLI + path: /datacenter/ucp/2.1/reference/cli/ nosync: true samples: @@ -870,16 +885,26 @@ samples: manuals: - sectiontitle: Commercially Supported Docker Engine section: - - path: /cs-engine/install/ - title: Install CS Docker Engine - - path: /cs-engine/upgrade/ - title: Upgrade - - sectiontitle: Release notes + - sectiontitle: 1.13 section: - - path: /cs-engine/release-notes/release-notes/ - title: CS Engine release notes - - path: /cs-engine/release-notes/prior-release-notes/ - title: Prior CS Engine release notes + - path: /cs-engine/1.13/ + title: Install + - path: /cs-engine/1.13/upgrade/ + title: Upgrade + - path: /cs-engine/1.13/release-notes/ + title: Release notes + - sectiontitle: 1.12 + section: + - path: /cs-engine/1.12/install/ + title: Install CS Docker Engine + - path: /cs-engine/1.12/upgrade/ + title: Upgrade + - sectiontitle: Release notes + section: + - path: /cs-engine/1.12/release-notes/release-notes/ + title: CS Engine release notes + - path: /cs-engine/1.12/release-notes/prior-release-notes/ + title: Prior CS Engine release notes - sectiontitle: Docker Cloud section: - path: /docker-cloud/ @@ -1074,15 +1099,24 @@ manuals: title: start - path: /compose/reference/stop/ title: stop + - path: /compose/reference/top/ + title: top - path: /compose/reference/unpause/ title: unpause - path: /compose/reference/up/ title: up - - path: /compose/compose-file/ - title: Compose file reference - nosync: true - - path: /compose/faq/ - title: Frequently Asked Questions + - sectiontitle: Compose File Reference + section: + - path: /compose/compose-file/ + title: Version 3 + - path: /compose/compose-file/compose-file-v2/ + title: Version 2 + - path: /compose/compose-file/compose-file-v1/ + title: Version 1 + - path: /compose/compose-file/compose-versioning/ + title: About versions and upgrading + - path: /compose/faq/ + title: Frequently Asked Questions - path: /compose/bundles/ title: Docker Stacks and Distributed Application Bundles - path: /compose/swarm/ @@ -1107,216 +1141,362 @@ manuals: title: Deploy Datacenter on AWS - path: /datacenter/install/linux/ title: Deploy Datacenter on Linux - - sectiontitle: Universal Control Plane 2.0 + - sectiontitle: Universal Control Plane section: - - path: /datacenter/ucp/2.0/guides/ + - path: /datacenter/ucp/2.1/guides/ title: Universal Control Plane overview - - path: /datacenter/ucp/2.0/guides/architecture/ + - path: /datacenter/ucp/2.1/guides/architecture/ title: Architecture - - sectiontitle: Installation + - sectiontitle: Administration section: - - path: /datacenter/ucp/2.0/guides/installation/system-requirements/ - title: System requirements - - path: /datacenter/ucp/2.0/guides/installation/plan-production-install/ - title: Plan a production installation - - path: /datacenter/ucp/2.0/guides/installation/ - title: Install UCP for production - - path: /datacenter/ucp/2.0/guides/installation/install-offline/ - title: Install offline - - path: /datacenter/ucp/2.0/guides/installation/license/ - title: License UCP - - path: /datacenter/ucp/2.0/guides/installation/scale-your-cluster/ - title: Scale your cluster - - path: /datacenter/ucp/2.0/guides/installation/upgrade/ - title: Upgrade UCP - - path: /datacenter/ucp/2.0/guides/installation/uninstall/ - title: Uninstall UCP - - sectiontitle: Access UCP - section: - - path: /datacenter/ucp/2.0/guides/access-ucp/ - title: Web-based access - - path: /datacenter/ucp/2.0/guides/access-ucp/cli-based-access/ - title: CLI-based access - - sectiontitle: Configuration - section: - - path: /datacenter/ucp/2.0/guides/configuration/ - title: Use externally-signed certificates - - path: /datacenter/ucp/2.0/guides/configuration/configure-logs/ - title: Configure UCP logging - - path: /datacenter/ucp/2.0/guides/configuration/integrate-with-dtr/ - title: Integrate with Docker Trusted Registry - - path: /datacenter/ucp/2.0/guides/configuration/integrate-with-ldap/ - title: Integrate with LDAP - - path: /datacenter/ucp/2.0/guides/configuration/route-hostnames/ - title: Route hostnames to services - - sectiontitle: Monitor and troubleshoot - section: - - path: /datacenter/ucp/2.0/guides/monitor/ - title: Monitor your cluster - - path: /datacenter/ucp/2.0/guides/monitor/troubleshoot/ - title: Troubleshoot your cluster - - path: /datacenter/ucp/2.0/guides/monitor/troubleshoot-configurations/ - title: Troubleshoot cluster configurations - - sectiontitle: High-availability - section: - - path: /datacenter/ucp/2.0/guides/high-availability/ - title: Set up high availability - - path: /datacenter/ucp/2.0/guides/high-availability/backups-and-disaster-recovery/ + - sectiontitle: Install + section: + - path: /datacenter/ucp/2.1/guides/admin/install/system-requirements/ + title: System requirements + - path: /datacenter/ucp/2.1/guides/admin/install/plan-installation/ + title: Plan your installation + - path: /datacenter/ucp/2.1/guides/admin/install/ + title: Install + - path: /datacenter/ucp/2.1/guides/admin/install/install-offline/ + title: Install offline + - path: /datacenter/ucp/2.1/guides/admin/install/uninstall/ + title: Uninstall + - sectiontitle: Upgrade + section: + - path: /datacenter/ucp/2.1/guides/admin/upgrade/release-notes/ + title: Release notes + - path: /datacenter/ucp/2.1/guides/admin/upgrade/incompatibilities-and-breaking-changes/ + title: Incompatibilities and breaking changes + - path: /datacenter/ucp/2.1/guides/admin/upgrade/ + title: Upgrade + - sectiontitle: Configure + section: + - path: /datacenter/ucp/2.1/guides/admin/configure/license-your-installation/ + title: License your installation + - path: /datacenter/ucp/2.1/guides/admin/configure/use-your-own-tls-certificates/ + title: Use your own TLS certificates + - path: /datacenter/ucp/2.1/guides/admin/configure/scale-your-cluster/ + title: Scale your cluster + - path: /datacenter/ucp/2.1/guides/admin/configure/set-up-high-availability/ + title: Set up high availability + - path: /datacenter/ucp/2.1/guides/admin/configure/use-a-load-balancer/ + title: Use a load balancer + - path: /datacenter/ucp/2.1/guides/admin/configure/add-labels-to-cluster-nodes/ + title: Add labels to cluster nodes + - path: /datacenter/ucp/2.1/guides/admin/configure/store-logs-in-an-external-system/ + title: Store logs in an external system + - path: /datacenter/ucp/2.1/guides/admin/configure/restrict-services-to-worker-nodes/ + title: Restrict services to worker nodes + - path: /datacenter/ucp/2.1/guides/admin/configure/use-domain-names-to-access-services/ + title: Use domain names to access services + - path: /datacenter/ucp/2.1/guides/admin/configure/only-allow-running-signed-images/ + title: Only allow running signed images + - path: /datacenter/ucp/2.1/guides/admin/configure/use-trusted-images-for-ci/ + title: Use trusted images for continuous integration + - path: /datacenter/ucp/2.1/guides/admin/configure/external-auth/ + title: Integrate with LDAP + - sectiontitle: Manage users + section: + - path: /datacenter/ucp/2.1/guides/admin/manage-users/ + title: Authentication and authorization + - path: /datacenter/ucp/2.1/guides/admin/manage-users/create-and-manage-users/ + title: Create and manage users + - path: /datacenter/ucp/2.1/guides/admin/manage-users/create-and-manage-teams/ + title: Create and manage teams + - path: /datacenter/ucp/2.1/guides/admin/manage-users/permission-levels/ + title: Permission levels + - path: /datacenter/ucp/2.1/guides/admin/manage-users/recover-a-user-password/ + title: Recover a user password + - sectiontitle: Monitor and troubleshoot + section: + - path: /datacenter/ucp/2.1/guides/admin/monitor-and-troubleshoot/ + title: Monitor the cluster status + - path: /datacenter/ucp/2.1/guides/admin/monitor-and-troubleshoot/troubleshoot-with-logs/ + title: Troubleshoot with logs + - path: /datacenter/ucp/2.1/guides/admin/monitor-and-troubleshoot/troubleshoot-configurations/ + title: Troubleshoot configurations + - path: /datacenter/ucp/2.1/guides/admin/backups-and-disaster-recovery/ title: Backups and disaster recovery - - sectiontitle: User management + - sectiontitle: CLI reference + section: + - path: /datacenter/ucp/2.1/reference/cli/ + title: docker/ucp overview + - path: /datacenter/ucp/2.1/reference/cli/backup/ + title: backup + - path: /datacenter/ucp/2.1/reference/cli/dump-certs/ + title: dump-certs + - path: /datacenter/ucp/2.1/reference/cli/fingerprint/ + title: fingerprint + - path: /datacenter/ucp/2.1/reference/cli/id/ + title: id + - path: /datacenter/ucp/2.1/reference/cli/images/ + title: images + - path: /datacenter/ucp/2.1/reference/cli/install/ + title: install + - path: /datacenter/ucp/2.1/reference/cli/restart/ + title: restart + - path: /datacenter/ucp/2.1/reference/cli/restore/ + title: restore + - path: /datacenter/ucp/2.1/reference/cli/stop/ + title: stop + - path: /datacenter/ucp/2.1/reference/cli/support/ + title: support + - path: /datacenter/ucp/2.1/reference/cli/uninstall-ucp/ + title: uninstall-ucp + - path: /datacenter/ucp/2.1/reference/cli/upgrade/ + title: upgrade + - sectiontitle: User guides section: - - path: /datacenter/ucp/2.0/guides/user-management/ - title: Authentication and authorization - - path: /datacenter/ucp/2.0/guides/user-management/create-and-manage-users/ - title: Create and manage users - - path: /datacenter/ucp/2.0/guides/user-management/create-and-manage-teams/ - title: Create and manage teams - - path: /datacenter/ucp/2.0/guides/user-management/permission-levels/ - title: Permission levels - - sectiontitle: Applications + - sectiontitle: Access UCP + section: + - path: /datacenter/ucp/2.1/guides/user/access-ucp/ + title: Web-based access + - path: /datacenter/ucp/2.1/guides/user/access-ucp/cli-based-access/ + title: CLI-based access + - sectiontitle: Deploy an application + section: + - path: /datacenter/ucp/2.1/guides/user/services/deploy-a-service/ + title: Deploy a service + - path: /datacenter/ucp/2.1/guides/user/services/use-hostnames-to-access-your-service/ + title: Use hostnames to access your service + - path: /datacenter/ucp/2.1/guides/user/services/ + title: Deploy an app from the UI + - path: /datacenter/ucp/2.1/guides/user/services/deploy-app-cli/ + title: Deploy an app from the CLI + - sectiontitle: Secrets + section: + - path: /datacenter/ucp/2.1/guides/user/secrets/ + title: Manage secrets + - path: /datacenter/ucp/2.1/guides/user/secrets/grant-revoke-access/ + title: Grant access to secrets + - path: /datacenter/ucp/2.1/guides/get-support/ + title: Get support + - sectiontitle: Docker Trusted Registry + section: + - path: /datacenter/dtr/2.2/guides/ + title: Docker Trusted Registry overview + - path: /datacenter/dtr/2.2/guides/architecture/ + title: Architecture + - sectiontitle: Administration section: - - path: /datacenter/ucp/2.0/guides/applications/ - title: Deploy an app from the UI - - path: /datacenter/ucp/2.0/guides/applications/deploy-app-cli/ - title: Deploy an app from the CLI - - sectiontitle: Content trust + - sectiontitle: Install + section: + - path: /datacenter/dtr/2.2/guides/admin/install/system-requirements/ + title: System requirements + - path: /datacenter/dtr/2.2/guides/admin/install/ + title: Install + - path: /datacenter/dtr/2.2/guides/admin/install/install-offline/ + title: Install offline + - path: /datacenter/dtr/2.2/guides/admin/install/uninstall/ + title: Uninstall + - sectiontitle: Upgrade + section: + - path: /datacenter/dtr/2.2/guides/admin/upgrade/release-notes/ + title: Release notes + - path: /datacenter/dtr/2.2/guides/admin/upgrade/incompatibilities-and-breaking-changes/ + title: Incompatibilities and breaking changes + - path: /datacenter/dtr/2.2/guides/admin/upgrade/ + title: Upgrade + - sectiontitle: Configure + section: + - path: /datacenter/dtr/2.2/guides/admin/configure/license-your-installation/ + title: License your installation + - path: /datacenter/dtr/2.2/guides/admin/configure/use-your-own-tls-certificates/ + title: Use your own TLS certificates + - sectiontitle: External storage + section: + - path: /datacenter/dtr/2.2/guides/admin/configure/external-storage/ + title: Overview + - path: /datacenter/dtr/2.2/guides/admin/configure/external-storage/nfs/ + title: NFS + - path: /datacenter/dtr/2.2/guides/admin/configure/set-up-high-availability/ + title: Set up high availability + - path: /datacenter/dtr/2.2/guides/admin/configure/use-a-load-balancer/ + title: Use a load balancer + - path: /datacenter/dtr/2.2/guides/admin/configure/set-up-vulnerability-scans/ + title: Set up vulnerability scans + - path: /datacenter/dtr/2.2/guides/admin/configure/deploy-a-cache/ + title: Deploy a cache + - sectiontitle: Manage users + section: + - path: /datacenter/dtr/2.2/guides/admin/manage-users/ + title: Create and manage users + - path: /datacenter/dtr/2.2/guides/admin/manage-users/create-and-manage-users/ + title: Create and manage users + - path: /datacenter/dtr/2.2/guides/admin/manage-users/create-and-manage-teams/ + title: Create and manage teams + - path: /datacenter/dtr/2.2/guides/admin/manage-users/permission-levels/ + title: Permission levels + - sectiontitle: Monitor and troubleshoot + section: + - path: /datacenter/dtr/2.2/guides/admin/monitor-and-troubleshoot/ + title: Monitor the cluster status + - path: /datacenter/dtr/2.2/guides/admin/monitor-and-troubleshoot/troubleshoot-with-logs/ + title: Troubleshoot with logs + - path: /datacenter/dtr/2.2/guides/admin/backups-and-disaster-recovery/ + title: Backups and disaster recovery + - sectiontitle: CLI reference + section: + - path: /datacenter/dtr/2.2/reference/cli/ + title: Overview + - path: /datacenter/dtr/2.2/reference/cli/backup/ + title: backup + - path: /datacenter/dtr/2.2/reference/cli/destroy/ + title: destroy + - path: /datacenter/dtr/2.2/reference/cli/images/ + title: images + - path: /datacenter/dtr/2.2/reference/cli/install/ + title: install + - path: /datacenter/dtr/2.2/reference/cli/join/ + title: join + - path: /datacenter/dtr/2.2/reference/cli/reconfigure/ + title: reconfigure + - path: /datacenter/dtr/2.2/reference/cli/remove/ + title: remove + - path: /datacenter/dtr/2.2/reference/cli/restore/ + title: restore + - path: /datacenter/dtr/2.2/reference/cli/upgrade/ + title: upgrade + - sectiontitle: User guides section: - - path: /datacenter/ucp/2.0/guides/content-trust/ - title: Run only images you trust - - path: /datacenter/ucp/2.0/guides/content-trust/manage-trusted-repositories/ - title: Manage trusted repositories - - path: /datacenter/ucp/2.0/guides/content-trust/continuous-integration/ - title: Use trusted images for continuous integration - - sectiontitle: UCP Tool CLI + - sectiontitle: Access DTR + section: + - path: /datacenter/dtr/2.2/guides/user/access-dtr/ + title: Configure your Docker Engine + - path: /datacenter/dtr/2.2/guides/user/access-dtr/use-a-cache/ + title: Use a cache + - sectiontitle: Manage images + section: + - path: /datacenter/dtr/2.2/guides/user/manage-images/ + title: Create a repository + - path: /datacenter/dtr/2.2/guides/user/manage-images/pull-and-push-images/ + title: Pull and push images + - path: /datacenter/dtr/2.2/guides/user/manage-images/delete-images/ + title: Delete images + - path: /datacenter/dtr/2.2/guides/user/manage-images/scan-images-for-vulnerabilities/ + title: Scan images for vulnerabilities + - path: /datacenter/dtr/2.2/guides/user/manage-images/manage-trusted-repositories/ + title: Manage trusted repositories + - path: /datacenter/dtr/2.2/guides/user/create-and-manage-webhooks/ + title: Create and manage webhooks + - path: /datacenter/dtr/2.2/reference/api/ + title: API reference + - path: /datacenter/dtr/2.2/guides/support/ + title: Get support + - sectiontitle: Previous versions + section: + - sectiontitle: Universal Control Plane 2.0 section: - - path: /datacenter/ucp/2.0/reference/cli/ - title: docker/ucp overview - - path: /datacenter/ucp/2.0/reference/cli/backup/ - title: backup - - path: /datacenter/ucp/2.0/reference/cli/dump-certs/ - title: dump-certs - - path: /datacenter/ucp/2.0/reference/cli/fingerprint/ - title: fingerprint - - path: /datacenter/ucp/2.0/reference/cli/id/ - title: id - - path: /datacenter/ucp/2.0/reference/cli/images/ - title: images - - path: /datacenter/ucp/2.0/reference/cli/install/ - title: install - - path: /datacenter/ucp/2.0/reference/cli/restart/ - title: restart - - path: /datacenter/ucp/2.0/reference/cli/restore/ - title: restore - - path: /datacenter/ucp/2.0/reference/cli/stop/ - title: stop - - path: /datacenter/ucp/2.0/reference/cli/support/ - title: support - - path: /datacenter/ucp/2.0/reference/cli/uninstall-ucp/ - title: uninstall-ucp - - path: /datacenter/ucp/2.0/reference/cli/upgrade/ - title: upgrade + - path: /datacenter/ucp/2.0/guides/ + title: Universal Control Plane overview + - path: /datacenter/ucp/2.0/guides/architecture/ + title: Architecture + - sectiontitle: Installation + section: + - path: /datacenter/ucp/2.0/guides/installation/system-requirements/ + title: System requirements + - path: /datacenter/ucp/2.0/guides/installation/plan-production-install/ + title: Plan a production installation + - path: /datacenter/ucp/2.0/guides/installation/ + title: Install UCP for production + - path: /datacenter/ucp/2.0/guides/installation/install-offline/ + title: Install offline + - path: /datacenter/ucp/2.0/guides/installation/license/ + title: License UCP + - path: /datacenter/ucp/2.0/guides/installation/scale-your-cluster/ + title: Scale your cluster + - path: /datacenter/ucp/2.0/guides/installation/upgrade/ + title: Upgrade UCP + - path: /datacenter/ucp/2.0/guides/installation/uninstall/ + title: Uninstall UCP + - sectiontitle: Access UCP + section: + - path: /datacenter/ucp/2.0/guides/access-ucp/ + title: Web-based access + - path: /datacenter/ucp/2.0/guides/access-ucp/cli-based-access/ + title: CLI-based access + - sectiontitle: Configuration + section: + - path: /datacenter/ucp/2.0/guides/configuration/ + title: Use externally-signed certificates + - path: /datacenter/ucp/2.0/guides/configuration/configure-logs/ + title: Configure UCP logging + - path: /datacenter/ucp/2.0/guides/configuration/integrate-with-dtr/ + title: Integrate with Docker Trusted Registry + - path: /datacenter/ucp/2.0/guides/configuration/integrate-with-ldap/ + title: Integrate with LDAP + - path: /datacenter/ucp/2.0/guides/configuration/route-hostnames/ + title: Route hostnames to services + - sectiontitle: Monitor and troubleshoot + section: + - path: /datacenter/ucp/2.0/guides/monitor/ + title: Monitor your cluster + - path: /datacenter/ucp/2.0/guides/monitor/troubleshoot/ + title: Troubleshoot your cluster + - path: /datacenter/ucp/2.0/guides/monitor/troubleshoot-configurations/ + title: Troubleshoot cluster configurations + - sectiontitle: High-availability + section: + - path: /datacenter/ucp/2.0/guides/high-availability/ + title: Set up high availability + - path: /datacenter/ucp/2.0/guides/high-availability/backups-and-disaster-recovery/ + title: Backups and disaster recovery + - sectiontitle: User management + section: + - path: /datacenter/ucp/2.0/guides/user-management/ + title: Authentication and authorization + - path: /datacenter/ucp/2.0/guides/user-management/create-and-manage-users/ + title: Create and manage users + - path: /datacenter/ucp/2.0/guides/user-management/create-and-manage-teams/ + title: Create and manage teams + - path: /datacenter/ucp/2.0/guides/user-management/permission-levels/ + title: Permission levels + - sectiontitle: Applications + section: + - path: /datacenter/ucp/2.0/guides/applications/ + title: Deploy an app from the UI + - path: /datacenter/ucp/2.0/guides/applications/deploy-app-cli/ + title: Deploy an app from the CLI + - sectiontitle: Content trust + section: + - path: /datacenter/ucp/2.0/guides/content-trust/ + title: Run only images you trust + - path: /datacenter/ucp/2.0/guides/content-trust/manage-trusted-repositories/ + title: Manage trusted repositories + - path: /datacenter/ucp/2.0/guides/content-trust/continuous-integration/ + title: Use trusted images for continuous integration + - sectiontitle: CLI reference + section: + - path: /datacenter/ucp/2.0/reference/cli/ + title: docker/ucp overview + - path: /datacenter/ucp/2.0/reference/cli/backup/ + title: backup + - path: /datacenter/ucp/2.0/reference/cli/dump-certs/ + title: dump-certs + - path: /datacenter/ucp/2.0/reference/cli/fingerprint/ + title: fingerprint + - path: /datacenter/ucp/2.0/reference/cli/id/ + title: id + - path: /datacenter/ucp/2.0/reference/cli/images/ + title: images + - path: /datacenter/ucp/2.0/reference/cli/install/ + title: install + - path: /datacenter/ucp/2.0/reference/cli/restart/ + title: restart + - path: /datacenter/ucp/2.0/reference/cli/restore/ + title: restore + - path: /datacenter/ucp/2.0/reference/cli/stop/ + title: stop + - path: /datacenter/ucp/2.0/reference/cli/support/ + title: support + - path: /datacenter/ucp/2.0/reference/cli/uninstall-ucp/ + title: uninstall-ucp + - path: /datacenter/ucp/2.0/reference/cli/upgrade/ + title: upgrade - path: /datacenter/ucp/2.0/guides/support/ title: Get support - path: /datacenter/ucp/2.0/guides/release-notes/ title: Release Notes - - sectiontitle: Docker Trusted Registry 2.1 - section: - - path: /datacenter/dtr/2.1/guides/ - title: Docker Trusted Registry overview - - path: /datacenter/dtr/2.1/guides/architecture/ - title: Architecture - - sectiontitle: Installation - section: - - path: /datacenter/dtr/2.1/guides/install/system-requirements/ - title: System requirements - - path: /datacenter/dtr/2.1/guides/install/ - title: Install Docker Trusted Registry - - path: /datacenter/dtr/2.1/guides/install/install-offline/ - title: Install offline - - path: /datacenter/dtr/2.1/guides/install/license/ - title: License your deployment - - path: /datacenter/dtr/2.1/guides/install/scale-your-deployment/ - title: Scale your deployment - - path: /datacenter/dtr/2.1/guides/install/upgrade/ - title: Upgrade - - path: /datacenter/dtr/2.1/guides/install/uninstall/ - title: Uninstall - - sectiontitle: Configuration - section: - - path: /datacenter/dtr/2.1/guides/configure/ - title: Use your own certificates - - path: /datacenter/dtr/2.1/guides/configure/configure-storage/ - title: Storage configuration - - path: /datacenter/dtr/2.1/guides/configure/use-nfs/ - title: Use NFS - - sectiontitle: Monitor and troubleshoot - section: - - path: /datacenter/dtr/2.1/guides/monitor-troubleshoot/ - title: Monitor DTR - - path: /datacenter/dtr/2.1/guides/monitor-troubleshoot/troubleshoot/ - title: Troubleshoot DTR - - sectiontitle: High-availability - section: - - path: /datacenter/dtr/2.1/guides/high-availability/ - title: Set up high availability - - path: /datacenter/dtr/2.1/guides/high-availability/backups-and-disaster-recovery/ - title: Backups and disaster recovery - - sectiontitle: User management - section: - - path: /datacenter/dtr/2.1/guides/user-management/ - title: Authentication and authorization - - path: /datacenter/dtr/2.1/guides/user-management/create-and-manage-users/ - title: Create and manage users - - path: /datacenter/dtr/2.1/guides/user-management/create-and-manage-orgs/ - title: Create and manage organizations - - path: /datacenter/dtr/2.1/guides/user-management/create-and-manage-teams/ - title: Create and manage teams - - path: /datacenter/dtr/2.1/guides/user-management/permission-levels/ - title: Permission levels - - sectiontitle: Repositories and images - section: - - path: /datacenter/dtr/2.1/guides/repos-and-images/ - title: Configure your Docker Engine - - path: /datacenter/dtr/2.1/guides/repos-and-images/pull-an-image/ - title: Pull an image - - path: /datacenter/dtr/2.1/guides/repos-and-images/push-an-image/ - title: Push an image - - path: /datacenter/dtr/2.1/guides/repos-and-images/delete-an-image/ - title: Delete an image - - sectiontitle: Trusted Registry CLI - section: - - path: /datacenter/dtr/2.1/reference/cli/ - title: Overview - - path: /datacenter/dtr/2.1/reference/cli/backup/ - title: backup - - path: /datacenter/dtr/2.1/reference/cli/dumpcerts/ - title: dumpcerts - - path: /datacenter/dtr/2.1/reference/cli/images/ - title: images - - path: /datacenter/dtr/2.1/reference/cli/install/ - title: install - - path: /datacenter/dtr/2.1/reference/cli/join/ - title: join - - path: /datacenter/dtr/2.1/reference/cli/reconfigure/ - title: reconfigure - - path: /datacenter/dtr/2.1/reference/cli/remove/ - title: remove - - path: /datacenter/dtr/2.1/reference/cli/restore/ - title: restore - - path: /datacenter/dtr/2.1/reference/cli/upgrade/ - title: upgrade - - sectiontitle: Trusted Registry API - section: - - path: /apidocs/overview/ - title: Overview - - path: /datacenter/dtr/2.1/reference/api/ - title: API v.2.1 - - path: /datacenter/dtr/2.1/guides/release-notes/ - title: Release notes - - path: /datacenter/dtr/2.1/guides/support/ - title: Get support - - sectiontitle: Previous versions - section: - sectiontitle: Universal Control Plane 1.0 section: - path: /datacenter/ucp/1.1/overview/ @@ -1416,7 +1596,7 @@ manuals: - path: /datacenter/ucp/1.1/reference/join/ title: join - path: /datacenter/ucp/1.1/reference/regen-certs/ - title: regen-certs.md + title: regen-certs - path: /datacenter/ucp/1.1/reference/restart/ title: restart - path: /datacenter/ucp/1.1/reference/restore/ @@ -1433,6 +1613,100 @@ manuals: title: Get support - path: /datacenter/ucp/1.1/release_notes/ title: Release Notes + - sectiontitle: Docker Trusted Registry 2.1 + section: + - path: /datacenter/dtr/2.1/guides/ + title: Docker Trusted Registry overview + - path: /datacenter/dtr/2.1/guides/architecture/ + title: Architecture + - sectiontitle: Installation + section: + - path: /datacenter/dtr/2.1/guides/install/system-requirements/ + title: System requirements + - path: /datacenter/dtr/2.1/guides/install/ + title: Install Docker Trusted Registry + - path: /datacenter/dtr/2.1/guides/install/install-offline/ + title: Install offline + - path: /datacenter/dtr/2.1/guides/install/license/ + title: License your deployment + - path: /datacenter/dtr/2.1/guides/install/scale-your-deployment/ + title: Scale your deployment + - path: /datacenter/dtr/2.1/guides/install/upgrade/ + title: Upgrade + - path: /datacenter/dtr/2.1/guides/install/uninstall/ + title: Uninstall + - sectiontitle: Configuration + section: + - path: /datacenter/dtr/2.1/guides/configure/ + title: Use your own certificates + - path: /datacenter/dtr/2.1/guides/configure/configure-storage/ + title: Storage configuration + - path: /datacenter/dtr/2.1/guides/configure/use-nfs/ + title: Use NFS + - sectiontitle: Monitor and troubleshoot + section: + - path: /datacenter/dtr/2.1/guides/monitor-troubleshoot/ + title: Monitor DTR + - path: /datacenter/dtr/2.1/guides/monitor-troubleshoot/troubleshoot/ + title: Troubleshoot DTR + - sectiontitle: High-availability + section: + - path: /datacenter/dtr/2.1/guides/high-availability/ + title: Set up high availability + - path: /datacenter/dtr/2.1/guides/high-availability/backups-and-disaster-recovery/ + title: Backups and disaster recovery + - sectiontitle: User management + section: + - path: /datacenter/dtr/2.1/guides/user-management/ + title: Authentication and authorization + - path: /datacenter/dtr/2.1/guides/user-management/create-and-manage-users/ + title: Create and manage users + - path: /datacenter/dtr/2.1/guides/user-management/create-and-manage-orgs/ + title: Create and manage organizations + - path: /datacenter/dtr/2.1/guides/user-management/create-and-manage-teams/ + title: Create and manage teams + - path: /datacenter/dtr/2.1/guides/user-management/permission-levels/ + title: Permission levels + - sectiontitle: Repositories and images + section: + - path: /datacenter/dtr/2.1/guides/repos-and-images/ + title: Configure your Docker Engine + - path: /datacenter/dtr/2.1/guides/repos-and-images/pull-an-image/ + title: Pull an image + - path: /datacenter/dtr/2.1/guides/repos-and-images/push-an-image/ + title: Push an image + - path: /datacenter/dtr/2.1/guides/repos-and-images/delete-an-image/ + title: Delete an image + - sectiontitle: API and CLI reference + section: + - path: /datacenter/dtr/2.1/reference/api/ + title: API reference + - sectiontitle: CLI reference + section: + - path: /datacenter/dtr/2.1/reference/cli/ + title: Overview + - path: /datacenter/dtr/2.1/reference/cli/backup/ + title: backup + - path: /datacenter/dtr/2.1/reference/cli/dumpcerts/ + title: dumpcerts + - path: /datacenter/dtr/2.1/reference/cli/images/ + title: images + - path: /datacenter/dtr/2.1/reference/cli/install/ + title: install + - path: /datacenter/dtr/2.1/reference/cli/join/ + title: join + - path: /datacenter/dtr/2.1/reference/cli/reconfigure/ + title: reconfigure + - path: /datacenter/dtr/2.1/reference/cli/remove/ + title: remove + - path: /datacenter/dtr/2.1/reference/cli/restore/ + title: restore + - path: /datacenter/dtr/2.1/reference/cli/upgrade/ + title: upgrade + - path: /datacenter/dtr/2.1/guides/release-notes/ + title: Release notes + - path: /datacenter/dtr/2.1/guides/support/ + title: Get support - sectiontitle: Docker Trusted Registry 2.0 section: - path: /datacenter/dtr/2.0/ @@ -1545,6 +1819,8 @@ manuals: title: Get support - sectiontitle: Docker for Mac section: + - path: /docker-for-mac/ + title: Getting started - path: /docker-for-mac/docker-toolbox/ title: Docker for Mac vs. Docker Toolbox - path: /docker-for-mac/multi-arch/ @@ -1557,20 +1833,18 @@ manuals: title: Logs and Troubleshooting - path: /docker-for-mac/faqs/ title: FAQs - - path: /docker-for-mac/examples/ - title: Example Applications - path: /docker-for-mac/opensource/ title: Open Source Licensing - path: /docker-for-mac/release-notes/ title: Release Notes - sectiontitle: Docker for Windows section: + - path: /docker-for-windows/ + title: Getting started - path: /docker-for-windows/troubleshoot/ title: Logs and Troubleshooting - path: /docker-for-windows/faqs/ title: FAQs - - path: /docker-for-windows/examples/ - title: Example Applications - path: /docker-for-windows/opensource/ title: Open Source Licensing - path: /docker-for-windows/release-notes/ diff --git a/_includes/cli.md b/_includes/cli.md index 1fecee0f98..6a6e141408 100644 --- a/_includes/cli.md +++ b/_includes/cli.md @@ -76,4 +76,12 @@ {% endif %} +{% if site.data[page.datafolder][page.datafile].examples %} + +## Examples + +{{ site.data[page.datafolder][page.datafile].examples }} + +{% endif %} + {% endif %} diff --git a/_includes/components/ddc_url_list.html b/_includes/components/ddc_url_list.html index 1cf4890e53..2660762c6a 100644 --- a/_includes/components/ddc_url_list.html +++ b/_includes/components/ddc_url_list.html @@ -2,7 +2,7 @@ {% for data in site.data.ddc_offline_files %} {% if data.ucp-version == page.ucp_version %}
-
+
{% for tar-file in data.tar-files %} diff --git a/_includes/content/compose-matrix.md b/_includes/content/compose-matrix.md new file mode 100644 index 0000000000..61fb2745e0 --- /dev/null +++ b/_includes/content/compose-matrix.md @@ -0,0 +1,13 @@ +There are several versions of the Compose file format – 1, 2, 2.1 and 3. For +details on versions and how to upgrade, see +[Versioning](compose-versioning.md#versioning) and +[Upgrading](compose-versioning.md#upgrading). + +This table shows which Compose file versions support specific Docker releases. + +| **Compose file format** | **Docker Engine release** | +| ------------------- | ------------------ | +| 3.0 ; 3.1 | 1.13.0+ | +| 2.1 | 1.12.0+ | +| 2.0 | 1.10.0+ | +| 1.0 | 1.9.1.+ | diff --git a/_includes/content/compose-var-sub.md b/_includes/content/compose-var-sub.md new file mode 100644 index 0000000000..19b2f8e34d --- /dev/null +++ b/_includes/content/compose-var-sub.md @@ -0,0 +1,54 @@ +Your configuration options can contain environment variables. Compose uses the +variable values from the shell environment in which `docker-compose` is run. +For example, suppose the shell contains `EXTERNAL_PORT=8000` and you supply +this configuration: + + web: + build: . + ports: + - "${EXTERNAL_PORT}:5000" + +When you run `docker-compose up` with this configuration, Compose looks for +the `EXTERNAL_PORT` environment variable in the shell and substitutes its +value in. In this example, Compose resolves the port mapping to `"8000:5000"` +before creating the `web` container. + +If an environment variable is not set, Compose substitutes with an empty +string. In the example above, if `EXTERNAL_PORT` is not set, the value for the +port mapping is `:5000` (which is of course an invalid port mapping, and will +result in an error when attempting to create the container). + +You can set default values for environment variables using a +[`.env` file](env-file.md), which Compose will automatically look for. Values +set in the shell environment will override those set in the `.env` file. + + $ unset EXTERNAL_PORT + $ echo "EXTERNAL_PORT=6000" > .env + $ docker-compose up # EXTERNAL_PORT will be 6000 + $ export EXTERNAL_PORT=7000 + $ docker-compose up # EXTERNAL_PORT will be 7000 + +Both `$VARIABLE` and `${VARIABLE}` syntax are supported. +Additionally when using the [2.1 file format](compose-versioning.md#version-21), it +is possible to provide inline default values using typical shell syntax: + +- `${VARIABLE:-default}` will evaluate to `default` if `VARIABLE` is unset or + empty in the environment. +- `${VARIABLE-default}` will evaluate to `default` only if `VARIABLE` is unset + in the environment. + +Other extended shell-style features, such as `${VARIABLE/foo/bar}`, are not +supported. + +You can use a `$$` (double-dollar sign) when your configuration needs a literal +dollar sign. This also prevents Compose from interpolating a value, so a `$$` +allows you to refer to environment variables that you don't want processed by +Compose. + + web: + build: . + command: "$$VAR_NOT_INTERPOLATED_BY_COMPOSE" + +If you forget and use a single dollar sign (`$`), Compose interprets the value as an environment variable and will warn you: + + The VAR_NOT_INTERPOLATED_BY_COMPOSE is not set. Substituting an empty string. diff --git a/_includes/d4a_buttons.md b/_includes/d4a_buttons.md index c2bfa4ea1d..455d74ff4c 100644 --- a/_includes/d4a_buttons.md +++ b/_includes/d4a_buttons.md @@ -1,6 +1,20 @@ {% capture aws_button_latest %} -![Docker for AWS](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png) +![Docker for AWS](https://s3.amazonaws.com/cloudformation-examples/cloudformation-launch-stack.png) +{% endcapture %} +{% capture aws_blue_latest %} +Deploy Docker for AWS (stable) +{% endcapture %} +{% capture aws_blue_beta %} +Deploy Docker for AWS (beta) +{% endcapture %} + +{% capture azure_blue_latest %} +Deploy Docker for Azure (stable) +{% endcapture %} +{% capture azure_blue_beta %} +Deploy Docker for Azure (beta) {% endcapture %} {% capture azure_button_latest %} -![Docker for Azure](http://azuredeploy.net/deploybutton.png) +![Docker for Azure](http://azuredeploy.net/deploybutton.png) {% endcapture %} + diff --git a/_layouts/docs.html b/_layouts/docs.html index a4d9c0d9bd..dfb6b568d4 100644 --- a/_layouts/docs.html +++ b/_layouts/docs.html @@ -13,6 +13,8 @@ {% endif %} {% endfor %} {% endif %} + +{% if page.assignee %}{% assign assignee=page.assignee%}{% else %}{% assign assignee=page.defaultassignee%}{% endif %} {% assign edit_url = "https://github.com/docker/docker.github.io/edit/master/" | append: page.path %} {% for entry in site.data.not_edited_here.overrides %} @@ -49,13 +51,13 @@ div#autocompleteContainer { transition: all 0.5s; } + - {% if site.GH_ENV == "gh_pages" %}{% endif %} diff --git a/compose/compose-file/compose-file-v1.md b/compose/compose-file/compose-file-v1.md new file mode 100644 index 0000000000..6469d40a17 --- /dev/null +++ b/compose/compose-file/compose-file-v1.md @@ -0,0 +1,512 @@ +--- +description: Compose file reference +keywords: fig, composition, compose version 1, docker +redirect_from: +- /compose/yml +title: Compose file version 1 reference +--- + +These topics describe version 1 of the Compose file format. This is the oldest +version. + +For a Compose/Docker Engine compatibility matrix, and detailed guidelines on +versions and upgrading, see +[Compose file versions and upgrading](compose-versioning.md). + +## Service configuration reference + +The Version 1 Compose file is a [YAML](http://yaml.org/) file that defines [services](#service-configuration-reference). + +The default path for a Compose file is `./docker-compose.yml`. + +>**Tip:** You can use either a `.yml` or `.yaml` extension for this file. They both work. + +A service definition contains configuration which will be applied to each +container started for that service, much like passing command-line parameters to +`docker run`. + +As with `docker run`, options specified in the Dockerfile (e.g., `CMD`, +`EXPOSE`, `VOLUME`, `ENV`) are respected by default - you don't need to +specify them again in `docker-compose.yml`. + +This section contains a list of all configuration options supported by a service +definition in version 1. + +### build + +Configuration options that are applied at build time. + +`build` can specified as a string containing a path to the build +context. + + build: ./dir + +> **Note**: In the [version 1 file format](compose-versioning.md#version-1), `build` is different in +> two ways: +> +> 1. Only the string form (`build: .`) is allowed - not the object form that is allowed in Version 2 and up. +> 2. Using `build` together with [`image`](#image) is not allowed. Attempting to do so +> results in an error. + +#### dockerfile + +Alternate Dockerfile. + +Compose will use an alternate file to build with. A build path must also be +specified. + + build: . + dockerfile: Dockerfile-alternate + +> **Note**: In the [version 1 file format](compose-versioning.md#version-1), `dockerfile` is +> different from newer versions in two ways: +> +> 1. It appears alongside `build`, not as a sub-option: +> +> 2. Using `dockerfile` together with [`image`](#image) is not allowed. Attempting to do so results in an error. + +### cap_add, cap_drop + +Add or drop container capabilities. +See `man 7 capabilities` for a full list. + + cap_add: + - ALL + + cap_drop: + - NET_ADMIN + - SYS_ADMIN + +> **Note:** These options are ignored when +> [deploying a stack in swarm mode](/engine/reference/commandline/stack_deploy.md) +> with a (version 3) Compose file. + +### command + +Override the default command. + + command: bundle exec thin -p 3000 + +The command can also be a list, in a manner similar to +[dockerfile](/engine/reference/builder.md#cmd): + + command: [bundle, exec, thin, -p, 3000] + +### cgroup_parent + +Specify an optional parent cgroup for the container. + + cgroup_parent: m-executor-abcd + +### container_name + +Specify a custom container name, rather than a generated default name. + + container_name: my-web-container + +Because Docker container names must be unique, you cannot scale a service +beyond 1 container if you have specified a custom name. Attempting to do so +results in an error. + +### devices + +List of device mappings. Uses the same format as the `--device` docker +client create option. + + devices: + - "/dev/ttyUSB0:/dev/ttyUSB0" + +### dns + +Custom DNS servers. Can be a single value or a list. + + dns: 8.8.8.8 + dns: + - 8.8.8.8 + - 9.9.9.9 + +### dns_search + +Custom DNS search domains. Can be a single value or a list. + + dns_search: example.com + dns_search: + - dc1.example.com + - dc2.example.com + +### entrypoint + +Override the default entrypoint. + + entrypoint: /code/entrypoint.sh + +The entrypoint can also be a list, in a manner similar to +[dockerfile](/engine/reference/builder.md#entrypoint): + + entrypoint: + - php + - -d + - zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so + - -d + - memory_limit=-1 + - vendor/bin/phpunit + +> **Note:** Setting `entrypoint` will both override any default entrypoint set +> on the service's image with the `ENTRYPOINT` Dockerfile instruction, *and* +> clear out any default command on the image - meaning that if there's a `CMD` +> instruction in the Dockerfile, it will be ignored. + +### env_file + +Add environment variables from a file. Can be a single value or a list. + +If you have specified a Compose file with `docker-compose -f FILE`, paths in +`env_file` are relative to the directory that file is in. + +Environment variables specified in `environment` override these values. + + env_file: .env + + env_file: + - ./common.env + - ./apps/web.env + - /opt/secrets.env + +Compose expects each line in an env file to be in `VAR=VAL` format. Lines +beginning with `#` (i.e. comments) are ignored, as are blank lines. + + # Set Rails/Rack environment + RACK_ENV=development + +> **Note:** If your service specifies a [build](#build) option, variables +> defined in environment files will _not_ be automatically visible during the +> build. + +The value of `VAL` is used as is and not modified at all. For example if the value is +surrounded by quotes (as is often the case of shell variables), the quotes will be +included in the value passed to Compose. + +### environment + +Add environment variables. You can use either an array or a dictionary. Any +boolean values; true, false, yes no, need to be enclosed in quotes to ensure +they are not converted to True or False by the YML parser. + +Environment variables with only a key are resolved to their values on the +machine Compose is running on, which can be helpful for secret or host-specific values. + + environment: + RACK_ENV: development + SHOW: 'true' + SESSION_SECRET: + + environment: + - RACK_ENV=development + - SHOW=true + - SESSION_SECRET + +> **Note:** If your service specifies a [build](#build) option, variables +> defined in `environment` will _not_ be automatically visible during the +> build. + +### expose + +Expose ports without publishing them to the host machine - they'll only be +accessible to linked services. Only the internal port can be specified. + + expose: + - "3000" + - "8000" + +### extends + +Extend another service, in the current file or another, optionally overriding +configuration. + +You can use `extends` on any service together with other configuration keys. +The `extends` value must be a dictionary defined with a required `service` +and an optional `file` key. + + extends: + file: common.yml + service: webapp + +The `service` the name of the service being extended, for example +`web` or `database`. The `file` is the location of a Compose configuration +file defining that service. + +If you omit the `file` Compose looks for the service configuration in the +current file. The `file` value can be an absolute or relative path. If you +specify a relative path, Compose treats it as relative to the location of the +current file. + +You can extend a service that itself extends another. You can extend +indefinitely. Compose does not support circular references and `docker-compose` +returns an error if it encounters one. + +For more on `extends`, see the +[the extends documentation](extends.md#extending-services). + +### external_links + +Link to containers started outside this `docker-compose.yml` or even outside +of Compose, especially for containers that provide shared or common services. +`external_links` follow semantics similar to `links` when specifying both the +container name and the link alias (`CONTAINER:ALIAS`). + + external_links: + - redis_1 + - project_db_1:mysql + - project_db_1:postgresql + +### extra_hosts + +Add hostname mappings. Use the same values as the docker client `--add-host` parameter. + + extra_hosts: + - "somehost:162.242.195.82" + - "otherhost:50.31.209.229" + +An entry with the ip address and hostname will be created in `/etc/hosts` inside containers for this service, e.g: + + 162.242.195.82 somehost + 50.31.209.229 otherhost + +### image + +Specify the image to start the container from. Can either be a repository/tag or +a partial image ID. + + image: redis + image: ubuntu:14.04 + image: tutum/influxdb + image: example-registry.com:4000/postgresql + image: a4bc65fd + +If the image does not exist, Compose attempts to pull it, unless you have also +specified [build](#build), in which case it builds it using the specified +options and tags it with the specified tag. + +> **Note**: In the [version 1 file format](compose-versioning.md#version-1), using [`build`](#build) together +> with `image` is not allowed. Attempting to do so results in an error. + +### labels + +Add metadata to containers using [Docker labels](/engine/userguide/labels-custom-metadata.md). You can use either an array or a dictionary. + +It's recommended that you use reverse-DNS notation to prevent your labels from conflicting with those used by other software. + + labels: + com.example.description: "Accounting webapp" + com.example.department: "Finance" + com.example.label-with-empty-value: "" + + labels: + - "com.example.description=Accounting webapp" + - "com.example.department=Finance" + - "com.example.label-with-empty-value" + +### links + +Link to containers in another service. Either specify both the service name and +a link alias (`SERVICE:ALIAS`), or just the service name. + + web: + links: + - db + - db:database + - redis + +Containers for the linked service will be reachable at a hostname identical to +the alias, or the service name if no alias was specified. + +Links also express dependency between services in the same way as +[depends_on](#dependson), so they determine the order of service startup. + +> **Note:** If you define both links and [networks](#networks), services with +> links between them must share at least one network in common in order to +> communicate. + +### log_driver + +> [Version 1 file format](compose-versioning#version-1) only. In version 2 and up, use +> [logging](index.md#logging). + +Specify a log driver. The default is `json-file`. + + log_driver: syslog + +### log_opt + +> [Version 1 file format](compose-versioning#version-1) only. In version 2 and up, use +> [logging](index.md#logging). + +Specify logging options as key-value pairs. An example of `syslog` options: + + log_opt: + syslog-address: "tcp://192.168.0.42:123" + +### net + +> [Version 1 file format](compose-versioning.md#version-1) only. In version 2 and up, use +> [network_mode](index.md#networkmode) and [networks](index.md#networks). + +Network mode. Use the same values as the docker client `--net` parameter. +The `container:...` form can take a service name instead of a container name or +id. + + net: "bridge" + net: "host" + net: "none" + net: "container:[service name or container name/id]" + +### pid + + pid: "host" + +Sets the PID mode to the host PID mode. This turns on sharing between +container and the host operating system the PID address space. Containers +launched with this flag will be able to access and manipulate other +containers in the bare-metal machine's namespace and vise-versa. + +### ports + +Expose ports. Either specify both ports (`HOST:CONTAINER`), or just the container +port (a random host port will be chosen). + +> **Note:** When mapping ports in the `HOST:CONTAINER` format, you may experience +> erroneous results when using a container port lower than 60, because YAML will +> parse numbers in the format `xx:yy` as sexagesimal (base 60). For this reason, +> we recommend always explicitly specifying your port mappings as strings. + + ports: + - "3000" + - "3000-3005" + - "8000:8000" + - "9090-9091:8080-8081" + - "49100:22" + - "127.0.0.1:8001:8001" + - "127.0.0.1:5000-5010:5000-5010" + - "6060:6060/udp" + +### security_opt + +Override the default labeling scheme for each container. + + security_opt: + - label:user:USER + - label:role:ROLE + +### stop_signal + +Sets an alternative signal to stop the container. By default `stop` uses +SIGTERM. Setting an alternative signal using `stop_signal` will cause +`stop` to send that signal instead. + + stop_signal: SIGUSR1 + +### ulimits + +Override the default ulimits for a container. You can either specify a single +limit as an integer or soft/hard limits as a mapping. + + + ulimits: + nproc: 65535 + nofile: + soft: 20000 + hard: 40000 + +### volumes, volume\_driver + +Mount paths or named volumes, optionally specifying a path on the host machine +(`HOST:CONTAINER`), or an access mode (`HOST:CONTAINER:ro`). +For [version 2 files](compose-versioning#version-2), named volumes need to be specified with the +[top-level `volumes` key](compose-file-v2.md#volume-configuration-reference). +When using [version 1](compose-versioning#version-1), the Docker Engine will create the named +volume automatically if it doesn't exist. + +You can mount a relative path on the host, which will expand relative to +the directory of the Compose configuration file being used. Relative paths +should always begin with `.` or `..`. + + volumes: + # Just specify a path and let the Engine create a volume + - /var/lib/mysql + + # Specify an absolute path mapping + - /opt/data:/var/lib/mysql + + # Path on the host, relative to the Compose file + - ./cache:/tmp/cache + + # User-relative path + - ~/configs:/etc/configs/:ro + + # Named volume + - datavolume:/var/lib/mysql + +If you do not use a host path, you may specify a `volume_driver`. + + volume_driver: mydriver + +There are several things to note, depending on which +[Compose file version](compose-versioning#versioning) you're using: + +- For [version 1 files](compose-versioning#version-1), both named volumes and + container volumes will use the specified driver. + +- No path expansion will be done if you have also specified a `volume_driver`. + For example, if you specify a mapping of `./foo:/data`, the `./foo` part + will be passed straight to the volume driver without being expanded. + +See [Docker Volumes](/engine/userguide/dockervolumes.md) and +[Volume Plugins](/engine/extend/plugins_volume.md) for more information. + +### volumes_from + +Mount all of the volumes from another service or container, optionally +specifying read-only access (``ro``) or read-write (``rw``). If no access level +is specified, then read-write will be used. + + volumes_from: + - service_name + - service_name:ro + +### cpu\_shares, cpu\_quota, cpuset, domainname, hostname, ipc, mac\_address, mem\_limit, memswap\_limit, oom_score_adj, privileged, read\_only, restart, shm\_size, stdin\_open, tty, user, working\_dir + +Each of these is a single value, analogous to its +[docker run](/engine/reference/run.md) counterpart. + + cpu_shares: 73 + cpu_quota: 50000 + cpuset: 0,1 + + user: postgresql + working_dir: /code + + domainname: foo.com + hostname: foo + ipc: host + mac_address: 02:42:ac:11:65:43 + + mem_limit: 1000000000 + memswap_limit: 2000000000 + privileged: true + + restart: always + + read_only: true + shm_size: 64M + stdin_open: true + tty: true + +## Compose documentation + +- [User guide](index.md) +- [Installing Compose](install.md) +- [Compose file versions and upgrading](compose-versioning.md) +- [Get started with Django](django.md) +- [Get started with Rails](rails.md) +- [Get started with WordPress](wordpress.md) +- [Command line reference](./reference/index.md) diff --git a/compose/compose-file/compose-file-v2.md b/compose/compose-file/compose-file-v2.md new file mode 100644 index 0000000000..19d7f8b25e --- /dev/null +++ b/compose/compose-file/compose-file-v2.md @@ -0,0 +1,1179 @@ +--- +description: Compose file reference +keywords: fig, composition, compose version 3, docker +redirect_from: +- /compose/yml +title: Compose file version 2 reference +--- + +These topics describe version 2 of the Compose file format. + +For a Compose/Docker Engine compatibility matrix, and detailed guidelines on +versions and upgrading, see +[Compose file versions and upgrading](compose-versioning.md). + +## Service configuration reference + +The Compose file is a [YAML](http://yaml.org/) file defining +[services](#service-configuration-reference), +[networks](#network-configuration-reference) and +[volumes](#volume-configuration-reference). +The default path for a Compose file is `./docker-compose.yml`. + +>**Tip:** You can use either a `.yml` or `.yaml` extension for this file. They both work. + +A [container](/engine/reference/glossary.md#container) definition contains configuration which will be applied to each +container started for that service, much like passing command-line parameters to +`docker run`. Likewise, network and volume definitions are analogous to +`docker network create` and `docker volume create`. + +As with `docker run`, options specified in the Dockerfile (e.g., `CMD`, +`EXPOSE`, `VOLUME`, `ENV`) are respected by default - you don't need to +specify them again in `docker-compose.yml`. + +You can use environment variables in configuration values with a Bash-like +`${VARIABLE}` syntax - see [variable substitution](#variable-substitution) for +full details. + +This section contains a list of all configuration options supported by a service +definition in version 2. + +### build + +Configuration options that are applied at build time. + +`build` can be specified either as a string containing a path to the build +context, or an object with the path specified under [context](#context) and +optionally [dockerfile](#dockerfile) and [args](#args). + + build: ./dir + + build: + context: ./dir + dockerfile: Dockerfile-alternate + args: + buildno: 1 + +If you specify `image` as well as `build`, then Compose names the built image +with the `webapp` and optional `tag` specified in `image`: + + build: ./dir + image: webapp:tag + +This will result in an image named `webapp` and tagged `tag`, built from `./dir`. + +#### context + +> [Version 2 file format](compose-versioning.md#version-2) and up. In version 1, just use +> [build](#build). + +Either a path to a directory containing a Dockerfile, or a url to a git repository. + +When the value supplied is a relative path, it is interpreted as relative to the +location of the Compose file. This directory is also the build context that is +sent to the Docker daemon. + +Compose will build and tag it with a generated name, and use that image thereafter. + + build: + context: ./dir + +#### dockerfile + +Alternate Dockerfile. + +Compose will use an alternate file to build with. A build path must also be +specified. + + build: + context: . + dockerfile: Dockerfile-alternate + +#### args + +> [Version 2 file format](compose-versioning.md#version-2) and up. + +Add build arguments, which are environment variables accessible only during the +build process. + +First, specify the arguments in your Dockerfile: + + ARG buildno + ARG password + + RUN echo "Build number: $buildno" + RUN script-requiring-password.sh "$password" + +Then specify the arguments under the `build` key. You can pass either a mapping +or a list: + + build: + context: . + args: + buildno: 1 + password: secret + + build: + context: . + args: + - buildno=1 + - password=secret + +You can omit the value when specifying a build argument, in which case its value +at build time is the value in the environment where Compose is running. + + args: + - buildno + - password + +> **Note**: YAML boolean values (`true`, `false`, `yes`, `no`, `on`, `off`) must +> be enclosed in quotes, so that the parser interprets them as strings. + +### cap_add, cap_drop + +Add or drop container capabilities. +See `man 7 capabilities` for a full list. + + cap_add: + - ALL + + cap_drop: + - NET_ADMIN + - SYS_ADMIN + +### command + +Override the default command. + + command: bundle exec thin -p 3000 + +The command can also be a list, in a manner similar to +[dockerfile](/engine/reference/builder.md#cmd): + + command: [bundle, exec, thin, -p, 3000] + +### cgroup_parent + +Specify an optional parent cgroup for the container. + + cgroup_parent: m-executor-abcd + +### container_name + +Specify a custom container name, rather than a generated default name. + + container_name: my-web-container + +Because Docker container names must be unique, you cannot scale a service +beyond 1 container if you have specified a custom name. Attempting to do so +results in an error. + +### devices + +List of device mappings. Uses the same format as the `--device` docker +client create option. + + devices: + - "/dev/ttyUSB0:/dev/ttyUSB0" + +### depends_on + +> [Version 2 file format](compose-versioning.md#version-2) and up. + +Express dependency between services, which has two effects: + +- `docker-compose up` will start services in dependency order. In the following + example, `db` and `redis` will be started before `web`. + +- `docker-compose up SERVICE` will automatically include `SERVICE`'s + dependencies. In the following example, `docker-compose up web` will also + create and start `db` and `redis`. + +Simple example: + + version: '2' + services: + web: + build: . + depends_on: + - db + - redis + redis: + image: redis + db: + image: postgres + +> **Note:** `depends_on` will not wait for `db` and `redis` to be "ready" before +> starting `web` - only until they have been started. If you need to wait +> for a service to be ready, see [Controlling startup order](startup-order.md) +> for more on this problem and strategies for solving it. + +> **[Version 2.1](#version-21) file format only.** + +A healthcheck indicates that you want a dependency to wait +for another container to be "healthy" (i.e. its healthcheck advertises a +successful state) before starting. + +Example: + + version: '2.1' + services: + web: + build: . + depends_on: + db: + condition: service_healthy + redis: + condition: service_started + redis: + image: redis + db: + image: redis + healthcheck: + test: "exit 0" + +In the above example, Compose will wait for the `redis` service to be started +(legacy behavior) and the `db` service to be healthy before starting `web`. + +See the [healthcheck section](#healthcheck) for complementary +information. + +### dns + +Custom DNS servers. Can be a single value or a list. + + dns: 8.8.8.8 + dns: + - 8.8.8.8 + - 9.9.9.9 + + +### dns_search + +Custom DNS search domains. Can be a single value or a list. + + dns_search: example.com + dns_search: + - dc1.example.com + - dc2.example.com + +### tmpfs + +> [Version 2 file format](compose-versioning.md#version-2) and up. + +Mount a temporary file system inside the container. Can be a single value or a list. + + tmpfs: /run + tmpfs: + - /run + - /tmp + +### entrypoint + +Override the default entrypoint. + + entrypoint: /code/entrypoint.sh + +The entrypoint can also be a list, in a manner similar to +[dockerfile](/engine/reference/builder.md#entrypoint): + + entrypoint: + - php + - -d + - zend_extension=/usr/local/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so + - -d + - memory_limit=-1 + - vendor/bin/phpunit + +> **Note:** Setting `entrypoint` will both override any default entrypoint set +> on the service's image with the `ENTRYPOINT` Dockerfile instruction, *and* +> clear out any default command on the image - meaning that if there's a `CMD` +> instruction in the Dockerfile, it will be ignored. + +### env_file + +Add environment variables from a file. Can be a single value or a list. + +If you have specified a Compose file with `docker-compose -f FILE`, paths in +`env_file` are relative to the directory that file is in. + +Environment variables specified in `environment` override these values. + + env_file: .env + + env_file: + - ./common.env + - ./apps/web.env + - /opt/secrets.env + +Compose expects each line in an env file to be in `VAR=VAL` format. Lines +beginning with `#` (i.e. comments) are ignored, as are blank lines. + + # Set Rails/Rack environment + RACK_ENV=development + +> **Note:** If your service specifies a [build](#build) option, variables +> defined in environment files will _not_ be automatically visible during the +> build. Use the [args](#args) sub-option of `build` to define build-time +> environment variables. + +The value of `VAL` is used as is and not modified at all. For example if the value is +surrounded by quotes (as is often the case of shell variables), the quotes will be +included in the value passed to Compose. + +### environment + +Add environment variables. You can use either an array or a dictionary. Any +boolean values; true, false, yes no, need to be enclosed in quotes to ensure +they are not converted to True or False by the YML parser. + +Environment variables with only a key are resolved to their values on the +machine Compose is running on, which can be helpful for secret or host-specific values. + + environment: + RACK_ENV: development + SHOW: 'true' + SESSION_SECRET: + + environment: + - RACK_ENV=development + - SHOW=true + - SESSION_SECRET + +> **Note:** If your service specifies a [build](#build) option, variables +> defined in `environment` will _not_ be automatically visible during the +> build. Use the [args](#args) sub-option of `build` to define build-time +> environment variables. + +### expose + +Expose ports without publishing them to the host machine - they'll only be +accessible to linked services. Only the internal port can be specified. + + expose: + - "3000" + - "8000" + +### extends + +Extend another service, in the current file or another, optionally overriding +configuration. + +You can use `extends` on any service together with other configuration keys. +The `extends` value must be a dictionary defined with a required `service` +and an optional `file` key. + + extends: + file: common.yml + service: webapp + +The `service` the name of the service being extended, for example +`web` or `database`. The `file` is the location of a Compose configuration +file defining that service. + +If you omit the `file` Compose looks for the service configuration in the +current file. The `file` value can be an absolute or relative path. If you +specify a relative path, Compose treats it as relative to the location of the +current file. + +You can extend a service that itself extends another. You can extend +indefinitely. Compose does not support circular references and `docker-compose` +returns an error if it encounters one. + +For more on `extends`, see the +[the extends documentation](extends.md#extending-services). + +### external_links + +Link to containers started outside this `docker-compose.yml` or even outside +of Compose, especially for containers that provide shared or common services. +`external_links` follow semantics similar to `links` when specifying both the +container name and the link alias (`CONTAINER:ALIAS`). + + external_links: + - redis_1 + - project_db_1:mysql + - project_db_1:postgresql + +> **Note:** For version 2 file format, the +> externally-created containers must be connected to at least one of the same +> networks as the service which is linking to them. + +### extra_hosts + +Add hostname mappings. Use the same values as the docker client `--add-host` parameter. + + extra_hosts: + - "somehost:162.242.195.82" + - "otherhost:50.31.209.229" + +An entry with the ip address and hostname will be created in `/etc/hosts` inside containers for this service, e.g: + + 162.242.195.82 somehost + 50.31.209.229 otherhost + +### group_add + +> [Version 2 file format](compose-versioning.md#version-2) and up. + +Specify additional groups (by name or number) which the user inside the +container will be a member of. Groups must exist in both the container and the +host system to be added. An example of where this is useful is when multiple +containers (running as different users) need to all read or write the same +file on the host system. That file can be owned by a group shared by all the +containers, and specified in `group_add`. See the +[Docker documentation](/engine/reference/run.md#additional-groups) for more +details. + +A full example: + + version: '2' + services: + image: alpine + group_add: + - mail + +Running `id` inside the created container will show that the user belongs to +the `mail` group, which would not have been the case if `group_add` were not +used. + +### healthcheck + +> [Version 2.1 file format](compose-versioning.md#version-21) and up. + +Configure a check that's run to determine whether or not containers for this +service are "healthy". See the docs for the +[HEALTHCHECK Dockerfile instruction](/engine/reference/builder.md#healthcheck) +for details on how healthchecks work. + + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost"] + interval: 1m30s + timeout: 10s + retries: 3 + +`interval` and `timeout` are specified as +[durations](#specifying-durations). + +`test` must be either a string or a list. If it's a list, the first item must be +either `NONE`, `CMD` or `CMD-SHELL`. If it's a string, it's equivalent to +specifying `CMD-SHELL` followed by that string. + + # Hit the local web app + test: ["CMD", "curl", "-f", "http://localhost"] + + # As above, but wrapped in /bin/sh. Both forms below are equivalent. + test: ["CMD-SHELL", "curl -f http://localhost && echo 'cool, it works'"] + test: curl -f https://localhost && echo 'cool, it works' + +To disable any default healthcheck set by the image, you can use `disable: +true`. This is equivalent to specifying `test: ["NONE"]`. + + healthcheck: + disable: true + +### image + +Specify the image to start the container from. Can either be a repository/tag or +a partial image ID. + + image: redis + image: ubuntu:14.04 + image: tutum/influxdb + image: example-registry.com:4000/postgresql + image: a4bc65fd + +If the image does not exist, Compose attempts to pull it, unless you have also +specified [build](#build), in which case it builds it using the specified +options and tags it with the specified tag. + +### isolation + +> [Added in version 2.1 file format](#version-21). + +Specify a container’s isolation technology. On Linux, the only supported value +is `default`. On Windows, acceptable values are `default`, `process` and +`hyperv`. Refer to the +[Docker Engine docs](/engine/reference/commandline/run.md#specify-isolation-technology-for-container---isolation) +for details. + +### labels + +Add metadata to containers using [Docker labels](/engine/userguide/labels-custom-metadata.md). You can use either an array or a dictionary. + +It's recommended that you use reverse-DNS notation to prevent your labels from conflicting with those used by other software. + + labels: + com.example.description: "Accounting webapp" + com.example.department: "Finance" + com.example.label-with-empty-value: "" + + labels: + - "com.example.description=Accounting webapp" + - "com.example.department=Finance" + - "com.example.label-with-empty-value" + +### links + +Link to containers in another service. Either specify both the service name and +a link alias (`SERVICE:ALIAS`), or just the service name. + + web: + links: + - db + - db:database + - redis + +Containers for the linked service will be reachable at a hostname identical to +the alias, or the service name if no alias was specified. + +Links also express dependency between services in the same way as +[depends_on](#dependson), so they determine the order of service startup. + +> **Note:** If you define both links and [networks](#networks), services with +> links between them must share at least one network in common in order to +> communicate. We recommend using networks instead. See [Version 2 file format](#version-2). + +### logging + +> [Version 2 file format](compose-versioning.md#version-2) and up. Used instead of version 1 +> options for [log_driver](#log_driver) and [log_opt](#log_opt). + +Logging configuration for the service. + + logging: + driver: syslog + options: + syslog-address: "tcp://192.168.0.42:123" + +The `driver` name specifies a logging driver for the service's +containers, as with the ``--log-driver`` option for docker run +([documented here](/engine/admin/logging/overview.md)). + +The default value is json-file. + + driver: "json-file" + driver: "syslog" + driver: "none" + +> **Note:** Only the `json-file` and `journald` drivers make the logs available directly from +> `docker-compose up` and `docker-compose logs`. Using any other driver will not +> print any logs. + +Specify logging options for the logging driver with the ``options`` key, as with the ``--log-opt`` option for `docker run`. + +Logging options are key-value pairs. An example of `syslog` options: + + driver: "syslog" + options: + syslog-address: "tcp://192.168.0.42:123" + +### log_opt + +> [Version 1 file format](compose-versioning.md#version-1) only. In version 2, use +> [logging](#logging). + +Specify logging options as key-value pairs. An example of `syslog` options: + + log_opt: + syslog-address: "tcp://192.168.0.42:123" + +### network_mode + +> [Version 2 file format](compose-versioning.md#version-2) and up. Replaces the version 1 [net](compose-file-v1.md#net) option. + +Network mode. Use the same values as the docker client `--net` parameter, plus +the special form `service:[service name]`. + + network_mode: "bridge" + network_mode: "host" + network_mode: "none" + network_mode: "service:[service name]" + network_mode: "container:[container name/id]" + +### networks + +> [Version 2 file format](compose-versioning.md#version-2) and up. Replaces the version 1 [net](compose-file-v1.md#net) option. + +Networks to join, referencing entries under the +[top-level `networks` key](#network-configuration-reference). + + services: + some-service: + networks: + - some-network + - other-network + +#### aliases + +Aliases (alternative hostnames) for this service on the network. Other containers on the same network can use either the service name or this alias to connect to one of the service's containers. + +Since `aliases` is network-scoped, the same service can have different aliases on different networks. + +> **Note**: A network-wide alias can be shared by multiple containers, and even by multiple services. If it is, then exactly which container the name will resolve to is not guaranteed. + +The general format is shown here. + + services: + some-service: + networks: + some-network: + aliases: + - alias1 + - alias3 + other-network: + aliases: + - alias2 + +In the example below, three services are provided (`web`, `worker`, and `db`), along with two networks (`new` and `legacy`). The `db` service is reachable at the hostname `db` or `database` on the `new` network, and at `db` or `mysql` on the `legacy` network. + + version: '2' + + services: + web: + build: ./web + networks: + - new + + worker: + build: ./worker + networks: + - legacy + + db: + image: mysql + networks: + new: + aliases: + - database + legacy: + aliases: + - mysql + + networks: + new: + legacy: + +#### ipv4_address, ipv6_address + +Specify a static IP address for containers for this service when joining the network. + +The corresponding network configuration in the [top-level networks section](#network-configuration-reference) must have an `ipam` block with subnet and gateway configurations covering each static address. If IPv6 addressing is desired, the [`enable_ipv6`](#enableipv6) option must be set. + +An example: + + version: '2.1' + + services: + app: + image: busybox + command: ifconfig + networks: + app_net: + ipv4_address: 172.16.238.10 + ipv6_address: 2001:3984:3989::10 + + networks: + app_net: + driver: bridge + enable_ipv6: true + ipam: + driver: default + config: + - subnet: 172.16.238.0/24 + gateway: 172.16.238.1 + - subnet: 2001:3984:3989::/64 + gateway: 2001:3984:3989::1 + +#### link_local_ips + +> [Added in version 2.1 file format](#version-21). + +Specify a list of link-local IPs. Link-local IPs are special IPs which belong +to a well known subnet and are purely managed by the operator, usually +dependent on the architecture where they are deployed. Therefore they are not +managed by docker (IPAM driver). + +Example usage: + + version: '2.1' + services: + app: + image: busybox + command: top + networks: + app_net: + link_local_ips: + - 57.123.22.11 + - 57.123.22.13 + networks: + app_net: + driver: bridge + +### pid + + pid: "host" + +Sets the PID mode to the host PID mode. This turns on sharing between +container and the host operating system the PID address space. Containers +launched with this flag will be able to access and manipulate other +containers in the bare-metal machine's namespace and vise-versa. + +### ports + +Expose ports. Either specify both ports (`HOST:CONTAINER`), or just the container +port (a random host port will be chosen). + +> **Note:** When mapping ports in the `HOST:CONTAINER` format, you may experience +> erroneous results when using a container port lower than 60, because YAML will +> parse numbers in the format `xx:yy` as sexagesimal (base 60). For this reason, +> we recommend always explicitly specifying your port mappings as strings. + + ports: + - "3000" + - "3000-3005" + - "8000:8000" + - "9090-9091:8080-8081" + - "49100:22" + - "127.0.0.1:8001:8001" + - "127.0.0.1:5000-5010:5000-5010" + - "6060:6060/udp" + +### security_opt + +Override the default labeling scheme for each container. + + security_opt: + - label:user:USER + - label:role:ROLE + +### stop_grace_period + +> [Added in version 2 file format](#version-2) + +Specify how long to wait when attempting to stop a container if it doesn't +handle SIGTERM (or whatever stop signal has been specified with +[`stop_signal`](#stopsignal)), before sending SIGKILL. Specified +as a [duration](#specifying-durations). + + stop_grace_period: 1s + stop_grace_period: 1m30s + +By default, `stop` waits 10 seconds for the container to exit before sending +SIGKILL. + +### stop_signal + +Sets an alternative signal to stop the container. By default `stop` uses +SIGTERM. Setting an alternative signal using `stop_signal` will cause +`stop` to send that signal instead. + + stop_signal: SIGUSR1 + +### sysctls + +> [Added in version 2.1 file format](#version-21). + +Kernel parameters to set in the container. You can use either an array or a +dictionary. + + sysctls: + net.core.somaxconn: 1024 + net.ipv4.tcp_syncookies: 0 + + sysctls: + - net.core.somaxconn=1024 + - net.ipv4.tcp_syncookies=0 + +### ulimits + +Override the default ulimits for a container. You can either specify a single +limit as an integer or soft/hard limits as a mapping. + + + ulimits: + nproc: 65535 + nofile: + soft: 20000 + hard: 40000 + +### userns_mode + +> [Added in version 2.1 file format](#version-21). + + userns_mode: "host" + +Disables the user namespace for this service, if Docker daemon is configured with user namespaces. +See [dockerd](/engine/reference/commandline/dockerd.md#disable-user-namespace-for-a-container) for +more information. + +### volumes, volume\_driver + +Mount paths or named volumes, optionally specifying a path on the host machine +(`HOST:CONTAINER`), or an access mode (`HOST:CONTAINER:ro`). +For [version 2 files](compose-versioning.md#version-2), named volumes need to be specified with the +[top-level `volumes` key](#volume-configuration-reference). +When using [version 1](compose-versioning.md#version-1), the Docker Engine will create the named +volume automatically if it doesn't exist. + +You can mount a relative path on the host, which will expand relative to +the directory of the Compose configuration file being used. Relative paths +should always begin with `.` or `..`. + + volumes: + # Just specify a path and let the Engine create a volume + - /var/lib/mysql + + # Specify an absolute path mapping + - /opt/data:/var/lib/mysql + + # Path on the host, relative to the Compose file + - ./cache:/tmp/cache + + # User-relative path + - ~/configs:/etc/configs/:ro + + # Named volume + - datavolume:/var/lib/mysql + +If you do not use a host path, you may specify a `volume_driver`. + + volume_driver: mydriver + +There are several things to note, depending on which +[Compose file version](#versioning) you're using: + +- You can use `volume_driver` in [version 2 files](#version-2), + but it will only apply to anonymous volumes (those specified in the image, + or specified under `volumes` without an explicit named volume or host path). + To configure the driver for a named volume, use the `driver` key under the + entry in the + [top-level `volumes` option](#volume-configuration-reference). + +- For [version 1 files](compose-versioning.md#version-1), both named volumes and + container volumes use the specified driver. This changes in version 2 per the above reference to anonymous volumes. + +- No path expansion will be done if you have also specified a `volume_driver`. + For example, if you specify a mapping of `./foo:/data`, the `./foo` part + will be passed straight to the volume driver without being expanded. + +See [Docker Volumes](/engine/userguide/dockervolumes.md) and +[Volume Plugins](/engine/extend/plugins_volume.md) for more information. + +### volumes_from + +Mount all of the volumes from another service or container, optionally +specifying read-only access (``ro``) or read-write (``rw``). If no access level is specified, +then read-write will be used. + + volumes_from: + - service_name + - service_name:ro + - container:container_name + - container:container_name:rw + +> **Note:** The `container:...` formats are only supported in the +> [version 2 file format](#version-2). In [version 1](compose-versioning.md#version-1), you can use +> container names without marking them as such: +> +> - service_name +> - service_name:ro +> - container_name +> - container_name:rw + +### cpu\_shares, cpu\_quota, cpuset, domainname, hostname, ipc, mac\_address, mem\_limit, memswap\_limit, oom_score_adj, privileged, read\_only, restart, shm\_size, stdin\_open, tty, user, working\_dir + +Each of these is a single value, analogous to its +[docker run](/engine/reference/run.md) counterpart. + + cpu_shares: 73 + cpu_quota: 50000 + cpuset: 0,1 + + user: postgresql + working_dir: /code + + domainname: foo.com + hostname: foo + ipc: host + mac_address: 02:42:ac:11:65:43 + + mem_limit: 1000000000 + memswap_limit: 2000000000 + privileged: true + + oom_score_adj: 500 + + restart: always + + read_only: true + shm_size: 64M + stdin_open: true + tty: true + +> **Note:** The following options are only available for +> [version 2](compose-versioning.md#version-2) and up: +> `oom_score_adj` + +## Specifying durations + +Some configuration options, such as the `interval` and `timeout` sub-options for +[`healthcheck`](#healthcheck), accept a duration as a string in a +format that looks like this: + + 2.5s + 10s + 1m30s + 2h32m + 5h34m56s + +The supported units are `us`, `ms`, `s`, `m` and `h`. + +## Volume configuration reference + +While it is possible to declare volumes on the fly as part of the service +declaration, this section allows you to create named volumes that can be +reused across multiple services (without relying on `volumes_from`), and are +easily retrieved and inspected using the docker command line or API. +See the [docker volume](/engine/reference/commandline/volume_create.md) +subcommand documentation for more information. + +Here's an example of a two-service setup where a database's data directory is +shared with another service as a volume so that it can be periodically backed +up: + + version: "3" + + services: + db: + image: db + volumes: + - data-volume:/var/lib/db + backup: + image: backup-service + volumes: + - data-volume:/var/lib/backup/data + + volumes: + data-volume: + +An entry under the top-level `volumes` key can be empty, in which case it will +use the default driver configured by the Engine (in most cases, this is the +`local` driver). Optionally, you can configure it with the following keys: + +### driver + +Specify which volume driver should be used for this volume. Defaults to whatever +driver the Docker Engine has been configured to use, which in most cases is +`local`. If the driver is not available, the Engine will return an error when +`docker-compose up` tries to create the volume. + + driver: foobar + +### driver_opts + +Specify a list of options as key-value pairs to pass to the driver for this +volume. Those options are driver-dependent - consult the driver's +documentation for more information. Optional. + + driver_opts: + foo: "bar" + baz: 1 + +### external + +If set to `true`, specifies that this volume has been created outside of +Compose. `docker-compose up` will not attempt to create it, and will raise +an error if it doesn't exist. + +`external` cannot be used in conjunction with other volume configuration keys +(`driver`, `driver_opts`). + +In the example below, instead of attempting to create a volume called +`[projectname]_data`, Compose will look for an existing volume simply +called `data` and mount it into the `db` service's containers. + + version: '2' + + services: + db: + image: postgres + volumes: + - data:/var/lib/postgresql/data + + volumes: + data: + external: true + +You can also specify the name of the volume separately from the name used to +refer to it within the Compose file: + + volumes: + data: + external: + name: actual-name-of-volume + +### labels + +> [Added in version 2.1 file format](#version-21). + +Add metadata to containers using +[Docker labels](/engine/userguide/labels-custom-metadata.md). You can use either +an array or a dictionary. + +It's recommended that you use reverse-DNS notation to prevent your labels from +conflicting with those used by other software. + + labels: + com.example.description: "Database volume" + com.example.department: "IT/Ops" + com.example.label-with-empty-value: "" + + labels: + - "com.example.description=Database volume" + - "com.example.department=IT/Ops" + - "com.example.label-with-empty-value" + + +## Network configuration reference + +The top-level `networks` key lets you specify networks to be created. For a full +explanation of Compose's use of Docker networking features, see the +[Networking guide](networking.md). + +### driver + +Specify which driver should be used for this network. + +The default driver depends on how the Docker Engine you're using is configured, +but in most instances it will be `bridge` on a single host and `overlay` on a +Swarm. + +The Docker Engine will return an error if the driver is not available. + + driver: overlay + +### driver_opts + +Specify a list of options as key-value pairs to pass to the driver for this +network. Those options are driver-dependent - consult the driver's +documentation for more information. Optional. + + driver_opts: + foo: "bar" + baz: 1 + +### enable_ipv6 + +> [Added in version 2.1 file format](#version-21). + +Enable IPv6 networking on this network. + +### ipam + +Specify custom IPAM config. This is an object with several properties, each of +which is optional: + +- `driver`: Custom IPAM driver, instead of the default. +- `config`: A list with zero or more config blocks, each containing any of + the following keys: + - `subnet`: Subnet in CIDR format that represents a network segment + - `ip_range`: Range of IPs from which to allocate container IPs + - `gateway`: IPv4 or IPv6 gateway for the master subnet + - `aux_addresses`: Auxiliary IPv4 or IPv6 addresses used by Network driver, + as a mapping from hostname to IP + +A full example: + + ipam: + driver: default + config: + - subnet: 172.28.0.0/16 + ip_range: 172.28.5.0/24 + gateway: 172.28.5.254 + aux_addresses: + host1: 172.28.1.5 + host2: 172.28.1.6 + host3: 172.28.1.7 + +### internal + +> [Version 2 file format](compose-versioning.md#version-2) and up. + +By default, Docker also connects a bridge network to it to provide external +connectivity. If you want to create an externally isolated overlay network, +you can set this option to `true`. + +### labels + +> [Added in version 2.1 file format](#version-21). + +Add metadata to containers using +[Docker labels](/engine/userguide/labels-custom-metadata.md). You can use either +an array or a dictionary. + +It's recommended that you use reverse-DNS notation to prevent your labels from +conflicting with those used by other software. + + labels: + com.example.description: "Financial transaction network" + com.example.department: "Finance" + com.example.label-with-empty-value: "" + + labels: + - "com.example.description=Financial transaction network" + - "com.example.department=Finance" + - "com.example.label-with-empty-value" + +### external + +If set to `true`, specifies that this network has been created outside of +Compose. `docker-compose up` will not attempt to create it, and will raise +an error if it doesn't exist. + +`external` cannot be used in conjunction with other network configuration keys +(`driver`, `driver_opts`, `group_add`, `ipam`, `internal`). + +In the example below, `proxy` is the gateway to the outside world. Instead of +attempting to create a network called `[projectname]_outside`, Compose will +look for an existing network simply called `outside` and connect the `proxy` +service's containers to it. + + version: '2' + + services: + proxy: + build: ./proxy + networks: + - outside + - default + app: + build: ./app + networks: + - default + + networks: + outside: + external: true + +You can also specify the name of the network separately from the name used to +refer to it within the Compose file: + + networks: + outside: + external: + name: actual-name-of-network + +## Variable substitution + +{% include content/compose-var-sub.md %} + +## Compose documentation + +- [User guide](index.md) +- [Installing Compose](install.md) +- [Compose file versions and upgrading](compose-versioning.md) +- [Get started with Django](django.md) +- [Get started with Rails](rails.md) +- [Get started with WordPress](wordpress.md) +- [Command line reference](./reference/index.md) diff --git a/compose/compose-file/compose-versioning.md b/compose/compose-file/compose-versioning.md new file mode 100644 index 0000000000..9fc2ed401b --- /dev/null +++ b/compose/compose-file/compose-versioning.md @@ -0,0 +1,319 @@ +--- +description: Compose file reference +keywords: fig, composition, compose, versions, upgrading, docker +title: Compose file versions and upgrading +--- + +The Compose file is a [YAML](http://yaml.org/) file defining services, +networks, and volumes for a Docker application. + +The Compose file formats are now described in these references, specific to each version. + +| **Reference file** | **What changed in this version** | +| ------------------- | ------------------ | +|[Version 3](index.md) (most current, and recommended) |[Version 3 updates](#version-3) | +| [Version 2](compose-file-v2.md) |[Version 2 updates](#version-2) | +| [Version 1](compose-file-v1.md) | [Version 1 updates](#version-1) | + +The topics below explain the differences among the versions, Docker Engine +compatibility, and [how to upgrade](#upgrading). + +## Compatibility matrix + +{% include content/compose-matrix.md %} + +## Versioning + +There are currently three versions of the Compose file format: + +- Version 1, the legacy format. This is specified by +omitting a `version` key at the root of the YAML. + +- Version 2.x. This is specified with a `version: '2'` or `version: '2.1'` entry at the root of the YAML. + +- Version 3.x, the latest and recommended version, designed to +be cross-compatible between Compose and the Docker Engine's +[swarm mode](/engine/swarm/index.md). This is specified with a `version: '3'` or `version: '3.1'`, etc., entry at the root of the YAML. + + +The [Compatibility Matrix](#compatibility-matrix) shows Compose file versions mapped to Docker Engine releases. + +To move your project to a later version, see the [Upgrading](#upgrading) +section. + +> **Note:** If you're using +> [multiple Compose files](extends.md#different-environments) or +> [extending services](extends.md#extending-services), each file must be of the +> same version - you cannot, for example, mix version 1 and 2 in a single +> project. + +Several things differ depending on which version you use: + +- The structure and permitted configuration keys +- The minimum Docker Engine version you must be running +- Compose's behaviour with regards to networking + +These differences are explained below. + +### Version 1 + +Compose files that do not declare a version are considered "version 1". In those +files, all the [services](index.md#service-configuration-reference) are +declared at the root of the document. + +Version 1 is supported by **Compose up to 1.6.x**. It will be deprecated in a +future Compose release. + +Version 1 files cannot declare named +[volumes](index.md#volume-configuration-reference), [networks](index.md#network-configuration-reference) or +[build arguments](index.md#args). + +Compose does not take advantage of [networking](index.md#networking.md) when you use +version 1: every container is placed on the default `bridge` network and is +reachable from every other container at its IP address. You will need to use +[links](compose-file-v1.md#links) to enable discovery between containers. + +Example: + + web: + build: . + ports: + - "5000:5000" + volumes: + - .:/code + links: + - redis + redis: + image: redis + +### Version 2 + +Compose files using the version 2 syntax must indicate the version number at +the root of the document. All [services](compose-file-v2.md#service-configuration-reference) +must be declared under the `services` key. + +Version 2 files are supported by **Compose 1.6.0+** and require a Docker Engine +of version **1.10.0+**. + +Named [volumes](compose-file-v2.md#volume-configuration-reference) can be declared under the +`volumes` key, and [networks](compose-file-v2.md#network-configuration-reference) can be declared +under the `networks` key. + +By default, every container joins an application-wide default network, and is +discoverable at a hostname that's the same as the service name. This means +[links](compose-file-v2.md#links) are largely unnecessary. For more details, see +[Networking in Compose](compose-file-v2.md#networking.md). + +Simple example: + + version: '2' + services: + web: + build: . + ports: + - "5000:5000" + volumes: + - .:/code + redis: + image: redis + +A more extended example, defining volumes and networks: + + version: '2' + services: + web: + build: . + ports: + - "5000:5000" + volumes: + - .:/code + networks: + - front-tier + - back-tier + redis: + image: redis + volumes: + - redis-data:/var/lib/redis + networks: + - back-tier + volumes: + redis-data: + driver: local + networks: + front-tier: + driver: bridge + back-tier: + driver: bridge + +Several other options were added to support networking, such as: + +* [`aliases`](compose-file-v2.md#aliases) + +* The [`depends_on`](compose-file-v2.md#dependson) option can be used in place of links to indicate dependencies +between services and startup order. + + version: '2' + services: + web: + build: . + depends_on: + - db + - redis + redis: + image: redis + db: + image: postgres + +* [`ipv4_address`, `ipv6_address`](compose-file-v2.md#ipv4address-ipv6address) + +[Variable substitution](compose-file-v2.md#variable-substitution) also was added in Version 2. + +### Version 2.1 + +An upgrade of [version 2](#version-2) that introduces new parameters only +available with Docker Engine version **1.12.0+** + +Introduces the following additional parameters: + +- [`link_local_ips`](compose-file-v2.md#linklocalips) +- [`isolation`](compose-file-v2.md#isolation) +- `labels` for [volumes](compose-file-v2.md#volume-configuration-reference) and + [networks](compose-file-v2.md#network-configuration-reference) +- [`userns_mode`](compose-file-v2.md#userns_mode) +- [`healthcheck`](compose-file-v2.md#healthcheck) +- [`sysctls`](compose-file-v2.md#sysctls) + +### Version 3 + +Designed to be cross-compatible between Compose and the Docker Engine's +[swarm mode](/engine/swarm/index.md), version 3 removes several options and adds +several more. + +- Removed: `volume_driver`, `volumes_from`, `cpu_shares`, `cpu_quota`, `cpuset`, + `mem_limit`, `memswap_limit`. See the [upgrading](#upgrading) + guide for how to migrate away from these. + +- Added: [deploy](index.md#deploy) + +## Upgrading + +### Version 2.x to 3.x + +Between versions 2.x and 3.x, the structure of the Compose file is the same, but +several options have been removed: + +- `volume_driver`: Instead of setting the volume driver on the service, define + a volume using the + [top-level `volumes` option](index.md#volume-configuration-reference) + and specify the driver there. + + version: "3" + services: + db: + image: postgres + volumes: + - data:/var/lib/postgresql/data + volumes: + data: + driver: mydriver + +- `volumes_from`: To share a volume between services, define it using the + [top-level `volumes` option](index.md#volume-configuration-reference) + and reference it from each service that shares it using the + [service-level `volumes` option](index.md#volumes-volumedriver). + +- `cpu_shares`, `cpu_quota`, `cpuset`, `mem_limit`, `memswap_limit`: These + have been replaced by the [resources](index.md#resources) key under + `deploy`. Note that `deploy` configuration only takes effect when using + `docker stack deploy`, and is ignored by `docker-compose`. + +### Version 1 to 2.x + +In the majority of cases, moving from version 1 to 2 is a very simple process: + +1. Indent the whole file by one level and put a `services:` key at the top. +2. Add a `version: '2'` line at the top of the file. + +It's more complicated if you're using particular configuration features: + +- `dockerfile`: This now lives under the `build` key: + + build: + context: . + dockerfile: Dockerfile-alternate + +- `log_driver`, `log_opt`: These now live under the `logging` key: + + logging: + driver: syslog + options: + syslog-address: "tcp://192.168.0.42:123" + +- `links` with environment variables: As documented in the + [environment variables reference](link-env-deprecated.md), environment variables + created by + links have been deprecated for some time. In the new Docker network system, + they have been removed. You should either connect directly to the + appropriate hostname or set the relevant environment variable yourself, + using the link hostname: + + web: + links: + - db + environment: + - DB_PORT=tcp://db:5432 + +- `external_links`: Compose uses Docker networks when running version 2 + projects, so links behave slightly differently. In particular, two + containers must be connected to at least one network in common in order to + communicate, even if explicitly linked together. + + Either connect the external container to your app's + [default network](networking.md), or connect both the external container and + your service's containers to an + [external network](networking.md#using-a-pre-existing-network). + +- `net`: This is now replaced by [network_mode](compose-file-v1.md#network_mode): + + net: host -> network_mode: host + net: bridge -> network_mode: bridge + net: none -> network_mode: none + + If you're using `net: "container:[service name]"`, you must now use + `network_mode: "service:[service name]"` instead. + + net: "container:web" -> network_mode: "service:web" + + If you're using `net: "container:[container name/id]"`, the value does not + need to change. + + net: "container:cont-name" -> network_mode: "container:cont-name" + net: "container:abc12345" -> network_mode: "container:abc12345" + +- `volumes` with named volumes: these must now be explicitly declared in a + top-level `volumes` section of your Compose file. If a service mounts a + named volume called `data`, you must declare a `data` volume in your + top-level `volumes` section. The whole file might look like this: + + version: '2' + services: + db: + image: postgres + volumes: + - data:/var/lib/postgresql/data + volumes: + data: {} + + By default, Compose creates a volume whose name is prefixed with your + project name. If you want it to just be called `data`, declare it as + external: + + volumes: + data: + external: true + +## Compose file format references + +- [Compose file version 3](index.md) +- [Compose file version 2](compose-file-v2.md) +- [Compose file version 1](compose-file-v1.md) diff --git a/compose/compose-file.md b/compose/compose-file/index.md similarity index 64% rename from compose/compose-file.md rename to compose/compose-file/index.md index 145034c9bc..702491ad71 100644 --- a/compose/compose-file.md +++ b/compose/compose-file/index.md @@ -3,13 +3,23 @@ description: Compose file reference keywords: fig, composition, compose, docker redirect_from: - /compose/yml -title: Compose file reference +- /compose/compose-file-v3.md +title: Compose file version 3 reference --- +These topics describe version 3 of the Compose file format. This is the newest +version. + +For a Compose/Docker Engine compatibility matrix, and detailed guidelines on +versions and upgrading, see +[Compose file versions and upgrading](compose-versioning.md). + +## Service configuration reference + The Compose file is a [YAML](http://yaml.org/) file defining -[services](compose-file.md#service-configuration-reference), -[networks](compose-file.md#network-configuration-reference) and -[volumes](compose-file.md#volume-configuration-reference). +[services](#service-configuration-reference), +[networks](#network-configuration-reference) and +[volumes](#volume-configuration-reference). The default path for a Compose file is `./docker-compose.yml`. >**Tip:** You can use either a `.yml` or `.yaml` extension for this file. They both work. @@ -24,18 +34,11 @@ As with `docker run`, options specified in the Dockerfile (e.g., `CMD`, specify them again in `docker-compose.yml`. You can use environment variables in configuration values with a Bash-like -`${VARIABLE}` syntax - see [variable substitution](compose-file.md#variable-substitution) for -full details. - - -## Service configuration reference - -> **Note:** There are several versions of the Compose file format – 1, 2, 2.1 -> and 3. For more information, see the [Versioning](compose-file.md#versioning) -> section. +`${VARIABLE}` syntax - see [variable +substitution](compose-file.md#variable-substitution) for full details. This section contains a list of all configuration options supported by a service -definition. +definition in version 3. ### build @@ -61,22 +64,12 @@ with the `webapp` and optional `tag` specified in `image`: This will result in an image named `webapp` and tagged `tag`, built from `./dir`. -> **Note**: In the [version 1 file format](compose-file.md#version-1), `build` is different in -> two ways: -> -> 1. Only the string form (`build: .`) is allowed - not the object form. -> 2. Using `build` together with `image` is not allowed. Attempting to do so -> results in an error. - > **Note:** This option is ignored when > [deploying a stack in swarm mode](/engine/reference/commandline/stack_deploy.md) > with a (version 3) Compose file. The `docker stack` command accepts only pre-built images. #### context -> [Version 2 file format](compose-file.md#version-2) and up. In version 1, just use -> [build](compose-file.md#build). - Either a path to a directory containing a Dockerfile, or a url to a git repository. When the value supplied is a relative path, it is interpreted as relative to the @@ -99,22 +92,8 @@ specified. context: . dockerfile: Dockerfile-alternate -> **Note**: In the [version 1 file format](compose-file.md#version-1), `dockerfile` is -> different in two ways: -> -> 1. It appears alongside `build`, not as a sub-option: -> -> ``` -> build: . -> dockerfile: Dockerfile-alternate -> ``` -> -> 2. Using `dockerfile` together with `image` is not allowed. Attempting to do so results in an error. - #### args -> [Version 2 file format](compose-file.md#version-2) and up. - Add build arguments, which are environment variables accessible only during the build process. @@ -200,7 +179,7 @@ results in an error. ### deploy -> **[Version 3](compose-file.md#version-3) only.** +> **[Version 3](compose-versioning.md#version-3) only.** Specify configuration related to the deployment and running of services. This only takes effect when deploying to a [swarm](/engine/swarm/index.md) with @@ -256,9 +235,11 @@ updates. - `monitor`: Duration after each task update to monitor for failure `(ns|us|ms|s|m|h)` (default 0s). - `max_failure_ratio`: Failure rate to tolerate during an update. +``` update_config: parallelism: 2 delay: 10s +``` #### resources @@ -266,13 +247,18 @@ Configures resource constraints. This replaces the older resource constraint options in Compose files prior to version 3 (`cpu_shares`, `cpu_quota`, `cpuset`, `mem_limit`, `memswap_limit`). - resources: - limits: - cpus: '0.001' - memory: 50M - reservations: - cpus: '0.0001' - memory: 20M +Each of these is a single value, analogous to its +[docker run](/engine/reference/run.md) counterpart. + +``` +resources: + limits: + cpus: '0.001' + memory: 50M + reservations: + cpus: '0.0001' + memory: 20M +``` #### restart_policy @@ -288,11 +274,13 @@ Configures if and how to restart containers when they exit. Replaces specified as a [duration](compose-file.md#specifying-durations) (default: decide immediately). +``` restart_policy: condition: on-failure delay: 5s max_attempts: 3 window: 120s +``` #### labels @@ -355,12 +343,10 @@ Simple example: > **Note:** `depends_on` will not wait for `db` and `redis` to be "ready" before > starting `web` - only until they have been started. If you need to wait -> for a service to be ready, see [Controlling startup order](startup-order.md) +> for a service to be ready, see [Controlling startup order](/compose/startup-order.md) > for more on this problem and strategies for solving it. -> **[Version 2.1](compose-file.md#version-21) file format only.** - -With Compose 1.10, it is now possible to indicate you want a dependency to wait +A healthcheck indicates you want a dependency to wait for another container to be "healthy" (i.e. its healthcheck advertises a successful state) before starting. @@ -385,7 +371,7 @@ Example: In the above example, Compose will wait for the `redis` service to be started (legacy behavior) and the `db` service to be healthy before starting `web`. -See the [healthcheck section](compose-file.md#healthcheck) for complementary +See the [healthcheck section](#healthcheck) for complementary information. ### dns @@ -416,7 +402,7 @@ Custom DNS search domains. Can be a single value or a list. ### tmpfs -> [Version 2 file format](compose-file.md#version-2) and up. +> [Version 2 file format](compose-versioning.md#version-2) and up. Mount a temporary file system inside the container. Can be a single value or a list. @@ -542,7 +528,7 @@ indefinitely. Compose does not support circular references and `docker-compose` returns an error if it encounters one. For more on `extends`, see the -[the extends documentation](extends.md#extending-services). +[the extends documentation](../extends.md#extending-services). > **Note:** This option is not yet supported when > [deploying a stack in swarm mode](/engine/reference/commandline/stack_deploy.md) @@ -561,9 +547,9 @@ container name and the link alias (`CONTAINER:ALIAS`). - project_db_1:mysql - project_db_1:postgresql -> **Note:** If you're using the [version 2 file format](compose-file.md#version-2), the +> **Note:** If you're using the [version 2 or above file format](compose-versioning.md#version-2), the > externally-created containers must be connected to at least one of the same -> networks as the service which is linking to them. +> networks as the service which is linking to them. Starting with Version 2, links are a legacy option. We recommend using networks instead. See [Version 2 file format](compose-versioning.md#version-2). > **Note:** This option is ignored when > [deploying a stack in swarm mode](/engine/reference/commandline/stack_deploy.md) @@ -584,7 +570,7 @@ An entry with the ip address and hostname will be created in `/etc/hosts` inside ### group_add -> [Version 2 file format](compose-file.md#version-2) and up. +> [Version 2 file format](compose-versioning.md#version-2) and up. Specify additional groups (by name or number) which the user inside the container will be a member of. Groups must exist in both the container and the @@ -657,13 +643,8 @@ If the image does not exist, Compose attempts to pull it, unless you have also specified [build](compose-file.md#build), in which case it builds it using the specified options and tags it with the specified tag. -> **Note**: In the [version 1 file format](compose-file.md#version-1), using `build` together -> with `image` is not allowed. Attempting to do so results in an error. - ### isolation -> [Added in version 2.1 file format](compose-file.md#version-21). - Specify a container’s isolation technology. On Linux, the only supported value is `default`. On Windows, acceptable values are `default`, `process` and `hyperv`. Refer to the @@ -672,7 +653,6 @@ for details. ### labels - Add metadata to containers using [Docker labels](/engine/userguide/labels-custom-metadata.md). You can use either an array or a dictionary. It's recommended that you use reverse-DNS notation to prevent your labels from conflicting with those used by other software. @@ -714,9 +694,6 @@ Links also express dependency between services in the same way as ### logging -> [Version 2 file format](compose-file.md#version-2) and up. In version 1, use -> [log_driver](compose-file.md#log_driver) and [log_opt](compose-file.md#log_opt). - Logging configuration for the service. logging: @@ -746,43 +723,8 @@ Logging options are key-value pairs. An example of `syslog` options: options: syslog-address: "tcp://192.168.0.42:123" -### log_driver - -> [Version 1 file format](compose-file.md#version-1) only. In version 2, use -> [logging](compose-file.md#logging). - -Specify a log driver. The default is `json-file`. - - log_driver: syslog - -### log_opt - -> [Version 1 file format](compose-file.md#version-1) only. In version 2, use -> [logging](compose-file.md#logging). - -Specify logging options as key-value pairs. An example of `syslog` options: - - log_opt: - syslog-address: "tcp://192.168.0.42:123" - -### net - -> [Version 1 file format](compose-file.md#version-1) only. In version 2, use -> [network_mode](compose-file.md#networkmode). - -Network mode. Use the same values as the docker client `--net` parameter. -The `container:...` form can take a service name instead of a container name or -id. - - net: "bridge" - net: "host" - net: "none" - net: "container:[service name or container name/id]" - ### network_mode -> [Version 2 file format](compose-file.md#version-2) and up. In version 1, use [net](compose-file.md#net). - Network mode. Use the same values as the docker client `--net` parameter, plus the special form `service:[service name]`. @@ -798,8 +740,6 @@ the special form `service:[service name]`. ### networks -> [Version 2 file format](compose-file.md#version-2) and up. In version 1, use [net](compose-file.md#net). - Networks to join, referencing entries under the [top-level `networks` key](compose-file.md#network-configuration-reference). @@ -863,7 +803,7 @@ In the example below, three services are provided (`web`, `worker`, and `db`), a Specify a static IP address for containers for this service when joining the network. -The corresponding network configuration in the [top-level networks section](compose-file.md#network-configuration-reference) must have an `ipam` block with subnet and gateway configurations covering each static address. If IPv6 addressing is desired, the [`enable_ipv6`](compose-file.md#enableipv6) option must be set. +The corresponding network configuration in the [top-level networks section](compose-file.md#network-configuration-reference) must have an `ipam` block with subnet configurations covering each static address. If IPv6 addressing is desired, the [`enable_ipv6`](compose-file.md#enableipv6) option must be set. An example: @@ -885,15 +825,13 @@ An example: ipam: driver: default config: - - subnet: 172.16.238.0/24 - gateway: 172.16.238.1 - - subnet: 2001:3984:3989::/64 - gateway: 2001:3984:3989::1 + - + subnet: 172.16.238.0/24 + - + subnet: 2001:3984:3989::/64 #### link_local_ips -> [Added in version 2.1 file format](compose-file.md#version-21). - Specify a list of link-local IPs. Link-local IPs are special IPs which belong to a well known subnet and are purely managed by the operator, usually dependent on the architecture where they are deployed. Therefore they are not @@ -958,8 +896,6 @@ Override the default labeling scheme for each container. ### stop_grace_period -> [Added in version 2 file format](compose-file.md#version-2) - Specify how long to wait when attempting to stop a container if it doesn't handle SIGTERM (or whatever stop signal has been specified with [`stop_signal`](compose-file.md#stopsignal)), before sending SIGKILL. Specified @@ -985,8 +921,6 @@ SIGTERM. Setting an alternative signal using `stop_signal` will cause ### sysctls -> [Added in version 2.1 file format](compose-file.md#version-21). - Kernel parameters to set in the container. You can use either an array or a dictionary. @@ -1016,8 +950,6 @@ limit as an integer or soft/hard limits as a mapping. ### userns_mode -> [Added in version 2.1 file format](compose-file.md#version-21). - userns_mode: "host" Disables the user namespace for this service, if Docker daemon is configured with user namespaces. @@ -1030,11 +962,15 @@ more information. ### volumes, volume\_driver +> **Note:** The top-level +> [`volumes` option](compose-file.md#volume-configuration-reference) defines +> a named volume and references it from each service's `volumes` list. This replaces `volumes_from` in earlier versions of the Compose file format. + Mount paths or named volumes, optionally specifying a path on the host machine (`HOST:CONTAINER`), or an access mode (`HOST:CONTAINER:ro`). -For [version 2 files](compose-file.md#version-2), named volumes need to be specified with the -[top-level `volumes` key](compose-file.md#volume-configuration-reference). -When using [version 1](compose-file.md#version-1), the Docker Engine will create the named +For [version 2 files](compose-versioning.md#version-2), named volumes need to be specified with the +[top-level `volumes` key](#volume-configuration-reference). +When using [version 1](compose-versioning.md#version-1), the Docker Engine will create the named volume automatically if it doesn't exist. You can mount a relative path on the host, which will expand relative to @@ -1062,24 +998,14 @@ If you do not use a host path, you may specify a `volume_driver`. volume_driver: mydriver There are several things to note, depending on which -[Compose file version](compose-file.md#versioning) you're using: +[Compose file version](compose-versioning.md#versioning) you're using: - `volume_driver` is not supported at all in - [version 3](compose-file.md#version-3). Instead of setting the volume driver + [version 3](compose-versioning.md#version-3). Instead of setting the volume driver on the service, define a volume using the - [top-level `volumes` option](compose-file.md#volume-configuration-reference) + [top-level `volumes` option](#volume-configuration-reference) and specify the driver there. -- You can use `volume_driver` in [version 2 files](compose-file.md#version-2), - but it will only apply to anonymous volumes (those specified in the image, - or specified under `volumes` without an explicit named volume or host path). - To configure the driver for a named volume, use the `driver` key under the - entry in the - [top-level `volumes` option](compose-file.md#volume-configuration-reference). - -- For [version 1 files](compose-file.md#version-1), both named volumes and - container volumes will use the specified driver. - - No path expansion will be done if you have also specified a `volume_driver`. For example, if you specify a mapping of `./foo:/data`, the `./foo` part will be passed straight to the volume driver without being expanded. @@ -1087,79 +1013,6 @@ There are several things to note, depending on which See [Docker Volumes](/engine/userguide/dockervolumes.md) and [Volume Plugins](/engine/extend/plugins_volume.md) for more information. -### volumes_from - -> **Removed in [version 3](compose-file.md#version-3).** The best way to share a -> volume between services is to use the top-level -> [`volumes` option](compose-file.md#volume-configuration-reference) to define -> a named volume and reference it from each service's `volumes` list. - -Mount all of the volumes from another service or container, optionally -specifying read-only access (``ro``) or read-write (``rw``). If no access level is specified, -then read-write will be used. - - volumes_from: - - service_name - - service_name:ro - - container:container_name - - container:container_name:rw - -> **Note:** The `container:...` formats are only supported in the -> [version 2 file format](compose-file.md#version-2). In [version 1](compose-file.md#version-1), you can use -> container names without marking them as such: -> -> - service_name -> - service_name:ro -> - container_name -> - container_name:rw - -### cpu\_shares, cpu\_quota, cpuset, domainname, hostname, ipc, mac\_address, mem\_limit, memswap\_limit, oom_score_adj, privileged, read\_only, restart, shm\_size, stdin\_open, tty, user, working\_dir - -> **Note:** Resource constraint options (`cpu_shares`, `cpu_quota`, `cpuset`, -> `mem_limit`, `memswap_limit`) have been removed in -> [version 3](compose-file.md#version-3). You should set resource constraints -> with [deploy.resources](compose-file.md#resources) instead. Note that `deploy` -> configuration only takes effect when using `docker stack deploy`, and is -> ignored by `docker-compose`. - -Each of these is a single value, analogous to its -[docker run](/engine/reference/run.md) counterpart. - - cpu_shares: 73 - cpu_quota: 50000 - cpuset: 0,1 - - user: postgresql - working_dir: /code - - domainname: foo.com - hostname: foo - ipc: host - mac_address: 02:42:ac:11:65:43 - - mem_limit: 1000000000 - memswap_limit: 2000000000 - privileged: true - - oom_score_adj: 500 - - restart: always - - read_only: true - shm_size: 64M - stdin_open: true - tty: true - -> **Note:** The following options are only available for -> [version 2](compose-file.md#version-2) and up: -> * `oom_score_adj` - -> **Note:** The `domainname`, `ipc`, `mac_address`, `privileged`, `read_only`, -> `restart` and `shm_size` options are ignored when -> [deploying a stack in swarm mode](/engine/reference/commandline/stack_deploy.md) -> with a (version 3) Compose file. - - ## Specifying durations Some configuration options, such as the `interval` and `timeout` sub-options for @@ -1261,8 +1114,6 @@ refer to it within the Compose file: ### labels -> [Added in version 2.1 file format](compose-file.md#version-21). - Add metadata to containers using [Docker labels](/engine/userguide/labels-custom-metadata.md). You can use either an array or a dictionary. @@ -1311,8 +1162,6 @@ documentation for more information. Optional. ### enable_ipv6 -> [Added in version 2.1 file format](compose-file.md#version-21). - Enable IPv6 networking on this network. ### ipam @@ -1324,10 +1173,6 @@ which is optional: - `config`: A list with zero or more config blocks, each containing any of the following keys: - `subnet`: Subnet in CIDR format that represents a network segment - - `ip_range`: Range of IPs from which to allocate container IPs - - `gateway`: IPv4 or IPv6 gateway for the master subnet - - `aux_addresses`: Auxiliary IPv4 or IPv6 addresses used by Network driver, - as a mapping from hostname to IP A full example: @@ -1335,25 +1180,15 @@ A full example: driver: default config: - subnet: 172.28.0.0/16 - ip_range: 172.28.5.0/24 - gateway: 172.28.5.254 - aux_addresses: - host1: 172.28.1.5 - host2: 172.28.1.6 - host3: 172.28.1.7 ### internal -> [Version 2 file format](compose-file.md#version-2) and up. - By default, Docker also connects a bridge network to it to provide external connectivity. If you want to create an externally isolated overlay network, you can set this option to `true`. ### labels -> [Added in version 2.1 file format](compose-file.md#version-21). - Add metadata to containers using [Docker labels](/engine/userguide/labels-custom-metadata.md). You can use either an array or a dictionary. @@ -1410,337 +1245,17 @@ refer to it within the Compose file: external: name: actual-name-of-network - -## Versioning - -There are currently four versions of the Compose file format: - -- Version 1, the legacy format. This is specified by omitting a `version` key at - the root of the YAML. -- Version 2. This is specified with a `version: '2'` entry at the root of the - YAML. -- Version 2.1, an upgrade over version 2 that takes advantage of newer Docker - Engine features. Specify with a `version: '2.1'` entry at the root of - the YAML. -- Version 3, the latest and recommended version, designed to be cross-compatible - between Compose and the Docker Engine's [swarm mode](/engine/swarm/index.md). - -To move your project to a later version, see the -[Upgrading](compose-file.md#upgrading) section. - -> **Note:** If you're using -> [multiple Compose files](extends.md#different-environments) or -> [extending services](extends.md#extending-services), each file must be of the -> same version - you cannot, for example, mix version 1 and 2 in a single -> project. - -Several things differ depending on which version you use: - -- The structure and permitted configuration keys -- The minimum Docker Engine version you must be running -- Compose's behaviour with regards to networking - -These differences are explained below. - - -### Version 1 - -Compose files that do not declare a version are considered "version 1". In -those files, all the [services](compose-file.md#service-configuration-reference) are declared -at the root of the document. - -Version 1 is supported by **Compose up to 1.6.x**. It will be deprecated in a -future Compose release. - -Version 1 files cannot declare named -[volumes](compose-file.md#volume-configuration-reference), [networks](networking.md) or -[build arguments](compose-file.md#args). - -Compose does not take advantage of [networking](networking.md) when you use -version 1: every container is placed on the default `bridge` network and is -reachable from every other container at its IP address. You will need to use -[links](compose-file.md#links) to enable discovery between containers. - -Example: - - web: - build: . - ports: - - "5000:5000" - volumes: - - .:/code - links: - - redis - redis: - image: redis - - -### Version 2 - -Compose files using the version 2 syntax must indicate the version number at -the root of the document. All [services](compose-file.md#service-configuration-reference) -must be declared under the `services` key. - -Version 2 files are supported by **Compose 1.6.0+** and require a Docker Engine -of version **1.10.0+**. - -Named [volumes](compose-file.md#volume-configuration-reference) can be declared under the -`volumes` key, and [networks](compose-file.md#network-configuration-reference) can be declared -under the `networks` key. - -By default, every container joins an application-wide default network, and is -discoverable at a hostname that's the same as the service name. This means -[links](compose-file.md#links) are largely unnecessary. For more details, see -[Networking in Compose](networking.md). - -Simple example: - - version: '2' - services: - web: - build: . - ports: - - "5000:5000" - volumes: - - .:/code - redis: - image: redis - -A more extended example, defining volumes and networks: - - version: '2' - services: - web: - build: . - ports: - - "5000:5000" - volumes: - - .:/code - networks: - - front-tier - - back-tier - redis: - image: redis - volumes: - - redis-data:/var/lib/redis - networks: - - back-tier - volumes: - redis-data: - driver: local - networks: - front-tier: - driver: bridge - back-tier: - driver: bridge - - -### Version 2.1 - -An upgrade of [version 2](compose-file.md#version-2) that introduces new parameters only -available with Docker Engine version **1.12.0+** - -Introduces the following additional parameters: - -- [`link_local_ips`](compose-file.md#linklocalips) -- [`isolation`](compose-file.md#isolation) -- `labels` for [volumes](compose-file.md#volume-configuration-reference) and - [networks](compose-file.md#network-configuration-reference) -- [`userns_mode`](compose-file.md#userns_mode) -- [`healthcheck`](compose-file.md#healthcheck), -- [`sysctls`](compose-file.md#sysctls) - -### Version 3 - -Designed to be cross-compatible between Compose and the Docker Engine's -[swarm mode](/engine/swarm/index.md), version 3 removes several options and adds -several more. - -- Removed: `volume_driver`, `volumes_from`, `cpu_shares`, `cpu_quota`, `cpuset`, - `mem_limit`, `memswap_limit`. See the [upgrading](compose-file.md#upgrading) - guide for how to migrate away from these. - -- Added: [deploy](compose-file.md#deploy) - -### Upgrading - -#### Version 2.x to 3.x - -Between versions 2.x and 3.x, the structure of the Compose file is the same, but -several options have been removed: - -- `volume_driver`: Instead of setting the volume driver on the service, define - a volume using the - [top-level `volumes` option](compose-file.md#volume-configuration-reference) - and specify the driver there. - - version: "3" - services: - db: - image: postgres - volumes: - - data:/var/lib/postgresql/data - volumes: - data: - driver: mydriver - -- `volumes_from`: To share a volume between services, define it using the - [top-level `volumes` option](compose-file.md#volume-configuration-reference) - and reference it from each service that shares it using the - [service-level `volumes` option](compose-file.md#volumes-volume-driver). - -- `cpu_shares`, `cpu_quota`, `cpuset`, `mem_limit`, `memswap_limit`: These - have been replaced by the [resources](compose-file.md#resources) key under - `deploy`. Note that `deploy` configuration only takes effect when using - `docker stack deploy`, and is ignored by `docker-compose`. - -#### Version 1 to 2.x - -In the majority of cases, moving from version 1 to 2 is a very simple process: - -1. Indent the whole file by one level and put a `services:` key at the top. -2. Add a `version: '2'` line at the top of the file. - -It's more complicated if you're using particular configuration features: - -- `dockerfile`: This now lives under the `build` key: - - build: - context: . - dockerfile: Dockerfile-alternate - -- `log_driver`, `log_opt`: These now live under the `logging` key: - - logging: - driver: syslog - options: - syslog-address: "tcp://192.168.0.42:123" - -- `links` with environment variables: As documented in the - [environment variables reference](link-env-deprecated.md), environment variables - created by - links have been deprecated for some time. In the new Docker network system, - they have been removed. You should either connect directly to the - appropriate hostname or set the relevant environment variable yourself, - using the link hostname: - - web: - links: - - db - environment: - - DB_PORT=tcp://db:5432 - -- `external_links`: Compose uses Docker networks when running version 2 - projects, so links behave slightly differently. In particular, two - containers must be connected to at least one network in common in order to - communicate, even if explicitly linked together. - - Either connect the external container to your app's - [default network](networking.md), or connect both the external container and - your service's containers to an - [external network](networking.md#using-a-pre-existing-network). - -- `net`: This is now replaced by [network_mode](compose-file.md#network_mode): - - net: host -> network_mode: host - net: bridge -> network_mode: bridge - net: none -> network_mode: none - - If you're using `net: "container:[service name]"`, you must now use - `network_mode: "service:[service name]"` instead. - - net: "container:web" -> network_mode: "service:web" - - If you're using `net: "container:[container name/id]"`, the value does not - need to change. - - net: "container:cont-name" -> network_mode: "container:cont-name" - net: "container:abc12345" -> network_mode: "container:abc12345" - -- `volumes` with named volumes: these must now be explicitly declared in a - top-level `volumes` section of your Compose file. If a service mounts a - named volume called `data`, you must declare a `data` volume in your - top-level `volumes` section. The whole file might look like this: - - version: '2' - services: - db: - image: postgres - volumes: - - data:/var/lib/postgresql/data - volumes: - data: {} - - By default, Compose creates a volume whose name is prefixed with your - project name. If you want it to just be called `data`, declare it as - external: - - volumes: - data: - external: true - ## Variable substitution -Your configuration options can contain environment variables. Compose uses the -variable values from the shell environment in which `docker-compose` is run. -For example, suppose the shell contains `EXTERNAL_PORT=8000` and you supply -this configuration: - - web: - build: . - ports: - - "${EXTERNAL_PORT}:5000" - -When you run `docker-compose up` with this configuration, Compose looks for -the `EXTERNAL_PORT` environment variable in the shell and substitutes its -value in. In this example, Compose resolves the port mapping to `"8000:5000"` -before creating the `web` container. - -If an environment variable is not set, Compose substitutes with an empty -string. In the example above, if `EXTERNAL_PORT` is not set, the value for the -port mapping is `:5000` (which is of course an invalid port mapping, and will -result in an error when attempting to create the container). - -You can set default values for environment variables using a -[`.env` file](env-file.md), which Compose will automatically look for. Values -set in the shell environment will override those set in the `.env` file. - - $ unset EXTERNAL_PORT - $ echo "EXTERNAL_PORT=6000" > .env - $ docker-compose up # EXTERNAL_PORT will be 6000 - $ export EXTERNAL_PORT=7000 - $ docker-compose up # EXTERNAL_PORT will be 7000 - -Both `$VARIABLE` and `${VARIABLE}` syntax are supported. -Additionally when using the [2.1 file format](compose-file.md#version-21), it -is possible to provide inline default values using typical shell syntax: - -- `${VARIABLE:-default}` will evaluate to `default` if `VARIABLE` is unset or - empty in the environment. -- `${VARIABLE-default}` will evaluate to `default` only if `VARIABLE` is unset - in the environment. - -Other extended shell-style features, such as `${VARIABLE/foo/bar}`, are not -supported. - -You can use a `$$` (double-dollar sign) when your configuration needs a literal -dollar sign. This also prevents Compose from interpolating a value, so a `$$` -allows you to refer to environment variables that you don't want processed by -Compose. - - web: - build: . - command: "$$VAR_NOT_INTERPOLATED_BY_COMPOSE" - -If you forget and use a single dollar sign (`$`), Compose interprets the value as an environment variable and will warn you: - - The VAR_NOT_INTERPOLATED_BY_COMPOSE is not set. Substituting an empty string. +{% include content/compose-var-sub.md %} ## Compose documentation - [User guide](index.md) -- [Installing Compose](install.md) -- [Get started with Django](django.md) -- [Get started with Rails](rails.md) -- [Get started with WordPress](wordpress.md) -- [Command line reference](./reference/index.md) +- [Installing Compose](/compose/install/) +- [Compose file versions and upgrading](compose-versioning.md) +- [Sample app with swarm mode](/engine/getstarted-voting-app/) +- [Get started with Django](/compose/django/) +- [Get started with Rails](/compose/rails/) +- [Get started with WordPress](/compose/wordpress/) +- [Command line reference](/compose/reference/) diff --git a/compose/gettingstarted.md b/compose/gettingstarted.md index 78e03aba2c..a0c2e895a2 100644 --- a/compose/gettingstarted.md +++ b/compose/gettingstarted.md @@ -151,6 +151,8 @@ containers](../engine/tutorials/dockervolumes.md). The number should increment. +>**Tip:** You can list local images with `docker image ls` and inspect them with `docker inspect `. Listing images at this point should return `redis` and `web`. + ## Step 5: Update the application diff --git a/compose/rails.md b/compose/rails.md index a8ef9018ef..5b88847b5c 100644 --- a/compose/rails.md +++ b/compose/rails.md @@ -8,7 +8,7 @@ This Quickstart guide will show you how to use Docker Compose to set up and run ### Define the project -Start by setting up the three files you'll need to build the app. First, since +Start by setting up the four files you'll need to build the app. First, since your app is going to run inside a Docker container containing all of its dependencies, you'll need to define exactly what needs to be included in the container. This is done using a file called `Dockerfile`. To begin with, the @@ -61,7 +61,7 @@ to link them together and expose the web app's port. ### Build the project -With those three files in place, you can now generate the Rails skeleton app +With those four files in place, you can now generate the Rails skeleton app using `docker-compose run`: docker-compose run web rails new . --force --database=postgresql --skip-bundle @@ -140,7 +140,7 @@ seconds—the familiar refrain: Finally, you need to create the database. In another terminal, run: - docker-compose run web rails db:create + docker-compose run web rake db:create That's it. Your app should now be running on port 3000 on your Docker daemon. If you're using [Docker Machine](/machine/overview.md), then `docker-machine ip MACHINE_VM` returns the Docker host IP address. diff --git a/compose/reference/index.md b/compose/reference/index.md index d8812dc6fe..04b9f3b3f3 100644 --- a/compose/reference/index.md +++ b/compose/reference/index.md @@ -8,10 +8,12 @@ The following pages describe the usage information for the [docker-compose](over * [docker-compose](overview.md) * [build](build.md) +* [bundle](bundle.md) * [config](config.md) * [create](create.md) * [down](down.md) * [events](events.md) +* [exec](exec.md) * [help](help.md) * [kill](kill.md) * [logs](logs.md) @@ -19,12 +21,14 @@ The following pages describe the usage information for the [docker-compose](over * [port](port.md) * [ps](ps.md) * [pull](pull.md) +* [push](push.md) * [restart](restart.md) * [rm](rm.md) * [run](run.md) * [scale](scale.md) * [start](start.md) * [stop](stop.md) +* [top](top.md) * [unpause](unpause.md) * [up](up.md) diff --git a/compose/reference/overview.md b/compose/reference/overview.md index f155bb5e4f..ca57b16027 100644 --- a/compose/reference/overview.md +++ b/compose/reference/overview.md @@ -14,7 +14,7 @@ command line. Define and run multi-container applications with Docker. Usage: - docker-compose [-f=...] [options] [COMMAND] [ARGS...] + docker-compose [-f ...] [options] [COMMAND] [ARGS...] docker-compose -h|--help Options: @@ -35,23 +35,27 @@ Options: Commands: build Build or rebuild services + bundle Generate a Docker bundle from the Compose file config Validate and view the compose file create Create services down Stop and remove containers, networks, images, and volumes events Receive real time events from containers + exec Execute a command in a running container help Get help on a command kill Kill containers logs View output from containers pause Pause services port Print the public port for a port binding ps List containers - pull Pulls service images + pull Pull service images + push Push service images restart Restart services rm Remove stopped containers run Run a one-off command scale Set number of containers for a service start Start services stop Stop services + top Display the running processes unpause Unpause services up Create and start containers version Show the Docker-Compose version information diff --git a/compose/reference/restart.md b/compose/reference/restart.md index cd66138107..f85aa739d4 100644 --- a/compose/reference/restart.md +++ b/compose/reference/restart.md @@ -11,4 +11,8 @@ Options: -t, --timeout TIMEOUT Specify a shutdown timeout in seconds. (default: 10) ``` -Restarts services. \ No newline at end of file +Restarts all stopped and running services. + +If you make changes to your docker-compose.yml configuration these changes will not be reflected after running this command. + +For example, changes to environment variables (which are added after a container is built, but before the container's command is executed) will not be updated after restarting. diff --git a/compose/reference/top.md b/compose/reference/top.md new file mode 100644 index 0000000000..106347e341 --- /dev/null +++ b/compose/reference/top.md @@ -0,0 +1,25 @@ +--- +description: Displays the running processes. +keywords: fig, composition, compose, docker, orchestration, cli, top +title: docker-compose top +--- + +```none +Usage: top [SERVICE...] + +``` + +Displays the running processes. + +```bash +$ docker-compose top +compose_service_a_1 +PID USER TIME COMMAND +---------------------------- +4060 root 0:00 top + +compose_service_b_1 +PID USER TIME COMMAND +---------------------------- +4115 root 0:00 top +``` \ No newline at end of file diff --git a/cs-engine/index.md b/cs-engine/1.12/index.md similarity index 83% rename from cs-engine/index.md rename to cs-engine/1.12/index.md index 934e3df18e..b8e75a9c23 100644 --- a/cs-engine/index.md +++ b/cs-engine/1.12/index.md @@ -3,6 +3,7 @@ description: Learn more about the Commercially Supported Docker Engine. keywords: docker, engine, documentation redirect_from: - /docker-trusted-registry/cs-engine/ +- /cs-engine/ title: Commercially Supported Docker Engine --- @@ -10,4 +11,4 @@ This section includes the following topics: * [Install CS Docker Engine](install.md) * [Upgrade](upgrade.md) -* [Release notes](release-notes/release-notes.md) \ No newline at end of file +* [Release notes](release-notes/release-notes.md) diff --git a/cs-engine/install.md b/cs-engine/1.12/install.md similarity index 94% rename from cs-engine/install.md rename to cs-engine/1.12/install.md index 50b745f03f..3dc59d49f4 100644 --- a/cs-engine/install.md +++ b/cs-engine/1.12/install.md @@ -5,6 +5,7 @@ redirect_from: - /docker-trusted-registry/install/engine-ami-launch/ - /docker-trusted-registry/install/install-csengine/ - /docker-trusted-registry/cs-engine/install/ +- /cs-engine/install/ title: Install Commercially Supported Docker Engine --- @@ -49,6 +50,13 @@ to update its RHEL kernel. This adds the repository of the latest version of CS Docker Engine. You can customize the URL to install an older version. + > **Note**: For users on RHEL 7.2 who have issues with installing the selinux + > policy, use the following command instead of the one above: + + ```bash + $ sudo yum-config-manager --add-repo https://packages.docker.com/1.12/yum/repo/main/rhel/7.2 + ``` + 5. Install Docker CS Engine: ```bash diff --git a/cs-engine/release-notes/index.md b/cs-engine/1.12/release-notes/index.md similarity index 77% rename from cs-engine/release-notes/index.md rename to cs-engine/1.12/release-notes/index.md index 8ee1f72260..2dec40c5aa 100644 --- a/cs-engine/release-notes/index.md +++ b/cs-engine/1.12/release-notes/index.md @@ -3,8 +3,9 @@ description: The release notes for CS Docker Engine. keywords: docker, engine, release notes redirect_from: - /docker-trusted-registry/cs-engine/release-notes/ +- /cs-engine/release-notes/ title: Commercially Supported Docker Engine release notes --- * [Release notes](release-notes.md) -* [Prior release notes](prior-release-notes.md) \ No newline at end of file +* [Prior release notes](prior-release-notes.md) diff --git a/cs-engine/release-notes/prior-release-notes.md b/cs-engine/1.12/release-notes/prior-release-notes.md similarity index 99% rename from cs-engine/release-notes/prior-release-notes.md rename to cs-engine/1.12/release-notes/prior-release-notes.md index 3208e0d52a..91767fd963 100644 --- a/cs-engine/release-notes/prior-release-notes.md +++ b/cs-engine/1.12/release-notes/prior-release-notes.md @@ -4,6 +4,7 @@ keywords: docker, documentation, about, technology, understanding, enterprise, h redirect_from: - /docker-trusted-registry/cse-prior-release-notes/ - /docker-trusted-registry/cs-engine/release-notes/prior-release-notes/ +- - /cs-engine/release-notes/prior-release-notes/ title: Release notes archive for Commercially Supported Docker Engine. --- diff --git a/cs-engine/release-notes/release-notes.md b/cs-engine/1.12/release-notes/release-notes.md similarity index 85% rename from cs-engine/release-notes/release-notes.md rename to cs-engine/1.12/release-notes/release-notes.md index 02a20304a9..b24320bca2 100644 --- a/cs-engine/release-notes/release-notes.md +++ b/cs-engine/1.12/release-notes/release-notes.md @@ -4,6 +4,7 @@ keywords: docker, documentation, about, technology, understanding, enterprise, h redirect_from: - /docker-trusted-registry/cse-release-notes/ - /docker-trusted-registry/cs-engine/release-notes/release-notes/ +- /cs-engine/release-notes/release-notes/ title: Commercially Supported Engine release notes --- @@ -21,6 +22,28 @@ cannot be adopted as quickly for consistency and compatibility reasons. These notes refer to the current and immediately prior releases of the CS Engine. For notes on older versions, see the [CS Engine prior release notes archive](prior-release-notes.md). +## CS Engine 1.12.6-cs8 +(8 Feb 2017) + +This release addresses the following issues: + +* Addresses performance issues introduced by external KV-Store access with the + `docker network ls` endpoint with large amounts of overlay networks and containers + attached to those networks + +* Addresses an inconsistent mac -> vtep binding issue when using overlay networks + +* Adds a new repository for RHEL 7.2 users, to deal with issues + users have encounted when installing the docker-engine-selinux package + on systems pinned to 7.2 packages that are older than those available in the + normal 7.2 install. This change relates to packaging changes for + [1.12.6-cs7](#cs-engine-1126-cs7). + + Users experiencing issues installing the selinux package should switch to this + repository. See [install instructions](/cs-engine/install.md) for more details. + Only switch to this repository if you encounter problems installing the + selinux packages from the centos/7 repo. + ## CS Engine 1.12.6-cs7 (24 Jan 2017) diff --git a/cs-engine/upgrade.md b/cs-engine/1.12/upgrade.md similarity index 99% rename from cs-engine/upgrade.md rename to cs-engine/1.12/upgrade.md index 32ee97feb6..fbdb29b31a 100644 --- a/cs-engine/upgrade.md +++ b/cs-engine/1.12/upgrade.md @@ -3,6 +3,7 @@ description: Learn how to install the commercially supported version of Docker E keywords: docker, engine, dtr, upgrade redirect_from: - /docker-trusted-registry/cs-engine/upgrade/ +- /cs-engine/upgrade/ title: Upgrade Commercially Supported Docker Engine --- @@ -262,4 +263,4 @@ Use these instructions to update APT-based systems. ```bash $ sudo apt-get upgrade docker-engine - ``` \ No newline at end of file + ``` diff --git a/cs-engine/1.13/index.md b/cs-engine/1.13/index.md new file mode 100644 index 0000000000..310dfe13fb --- /dev/null +++ b/cs-engine/1.13/index.md @@ -0,0 +1,186 @@ +--- +title: Install CS Docker Engine 1.13 +description: Learn how to install the commercially supported version of Docker Engine. +keywords: docker, engine, install +--- + +Follow these instructions to install CS Docker Engine, the commercially +supported version of Docker Engine. + +CS Docker Engine can be installed on the following operating systems: + + +* CentOS 7.1/7.2 & RHEL 7.0/7.1/7.2 (YUM-based systems) +* Ubuntu 14.04 LTS or 16.04 LTS +* SUSE Linux Enterprise 12 + + +## Install on CentOS 7.1/7.2 & RHEL 7.0/7.1/7.2/7.3 (YUM-based systems) + +This section explains how to install on CentOS 7.1/7.2 & RHEL 7.0/7.1/7.2/7.3. Only +these versions are supported. CentOS 7.0 is **not** supported. On RHEL, +depending on your current level of updates, you may need to reboot your server +to update its RHEL kernel. + +1. Log into the system as a user with root or sudo permissions. + +2. Add the Docker public key for CS packages: + + ```bash + $ sudo rpm --import "https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e" + ``` + +3. Install yum-utils if necessary: + + ```bash + $ sudo yum install -y yum-utils + ``` + +4. Add the Docker repository: + + ```bash + $ sudo yum-config-manager --add-repo https://packages.docker.com/1.13/yum/repo/main/centos/7 + ``` + + This adds the repository of the latest version of CS Docker Engine. You can + customize the URL to install an older version. + +5. Install Docker CS Engine: + + ```bash + $ sudo yum install docker-engine + ``` + +6. Configure devicemapper: + + By default, the `devicemapper` graph driver does not come pre-configured in a production ready state. Follow the documented step by step instructions to [configure devicemapper with direct-lvm for production](../../engine/userguide/storagedriver/device-mapper-driver/#/for-a-direct-lvm-mode-configuration) in order to achieve the best performance and reliability for your environment. + +7. Enable the Docker daemon as a service and start it. + + ```bash + $ sudo systemctl enable docker.service + $ sudo systemctl start docker.service + ``` + +8. Confirm the Docker daemon is running: + + ```bash + $ sudo docker info + ``` + +9. Optionally, add non-sudo access to the Docker socket by adding your user +to the `docker` group. + + ```bash + $ sudo usermod -a -G docker $USER + ``` + +10. Log out and log back in to have your new permissions take effect. + +## Install on Ubuntu 14.04 LTS or 16.04 LTS + +1. Log into the system as a user with root or sudo permissions. + +2. Add Docker's public key for CS packages: + + ```bash + $ curl -s 'https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e' | sudo apt-key add --import + ``` + +3. Install the HTTPS helper for apt (your system may already have it): + + ```bash + $ sudo apt-get update && sudo apt-get install apt-transport-https + ``` + +4. Install additional kernel modules to add AUFS support. + + ```bash + $ sudo apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual + ``` + +5. Add the repository for the new version: + + for 14.04: + + ```bash + $ echo "deb https://packages.docker.com/1.13/apt/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + ``` + + for 16.04: + + ```bash + $ echo "deb https://packages.docker.com/1.13/apt/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list + ``` + +6. Run the following to install commercially supported Docker Engine and its +dependencies: + + ```bash + $ sudo apt-get update && sudo apt-get install docker-engine + ``` + +7. Confirm the Docker daemon is running: + + ```bash + $ sudo docker info + ``` + +8. Optionally, add non-sudo access to the Docker socket by adding your +user to the `docker` group. + + ```bash + $ sudo usermod -a -G docker $USER + ``` + + Log out and log back in to have your new permissions take effect. + + +## Install on SUSE Linux Enterprise 12.3 + +1. Log into the system as a user with root or sudo permissions. + +2. Refresh your repository so that curl commands and CA certificates +are available: + + ```bash + $ sudo zypper ref + ``` + +3. Add the Docker repository and public key: + + ```bash + $ sudo zypper ar -t YUM https://packages.docker.com/1.13/yum/repo/main/opensuse/12.3 docker-1.13 + $ sudo rpm --import 'https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e' + ``` + + This adds the repository of the latest version of CS Docker Engine. You can + customize the URL to install an older version. + +4. Install the Docker daemon package: + + ```bash + $ sudo zypper install docker-engine + ``` + +5. Enable the Docker daemon as a service and then start it: + + ```bash + $ sudo systemctl enable docker.service + $ sudo systemctl start docker.service + ``` + +6. Confirm the Docker daemon is running: + + ```bash + $ sudo docker info + ``` + +7. Optionally, add non-sudo access to the Docker socket by adding your user +to the `docker` group. + + ```bash + $ sudo usermod -a -G docker $USER + ``` + +8. Log out and log back in to have your new permissions take effect. diff --git a/cs-engine/1.13/release-notes.md b/cs-engine/1.13/release-notes.md new file mode 100644 index 0000000000..a331b8151f --- /dev/null +++ b/cs-engine/1.13/release-notes.md @@ -0,0 +1,23 @@ +--- +title: CS Docker Engine 1.13 release notes +description: Commercially supported Docker Engine release notes +keywords: docker, engine, install, release notes + +--- + +This document describes the latest changes, additions, known issues, and fixes +for the commercially supported Docker Engine (CS Engine). + +The CS Engine is functionally equivalent to the corresponding Docker Engine that +it references. However, a commercially supported release also includes +back-ported fixes (security-related and priority defects) from the open source. +It incorporates defect fixes that you can use in environments where new features +cannot be adopted as quickly for consistency and compatibility reasons. + +## CS Engine 1.13.1-cs1 + +(08 Feb 2017) + +Refer to the detailed lists of changes since the release of CS Engine 1.12.6-cs8 +by reviewing the changes in [v1.13.0](https://github.com/docker/docker/releases/tag/v1.13.0) +and [v1.13.1](https://github.com/docker/docker/releases/tag/v1.13.1). diff --git a/cs-engine/1.13/upgrade.md b/cs-engine/1.13/upgrade.md new file mode 100644 index 0000000000..ac55e3abc4 --- /dev/null +++ b/cs-engine/1.13/upgrade.md @@ -0,0 +1,260 @@ +--- +title: Upgrade Commercially Supported Docker Engine +description: Learn how to upgrade the commercially supported version of Docker Engine. +keywords: docker, engine, upgrade +--- + +This article explains how to upgrade your CS Docker Engine. + +The upgrade process depends on the version that is currently installed and the +version that you want to upgrade to: + +* [Upgrade from the same minor version](upgrade.md#upgrade-from-the-same-minor-version) +* [Upgrade from the same major version](upgrade.md#upgrade-from-the-same-major-version) +* [Upgrade from a legacy version](upgrade.md#upgrade-from-a-legacy-version) + +Before starting the upgrade, make sure you stop all containers running on the +host. This ensures your containers have time for cleaning up before exiting, +thus avoiding data loss or corruption. + +## Upgrade from the same minor version + +Use these instructions if you're upgrading your CS Docker Engine within the +same minor version. As an example, from 1.1.0 to 1.1.1. + +### CentOS 7.1 & RHEL 7.0/7.1/7.2 +Use these instructions to upgrade YUM-based systems. + +1. Update your docker-engine package: + + ```bash + $ sudo yum upgrade docker-engine + ``` + +2. Check that the CS Docker Engine is running: + + ```bash + $ sudo docker info + ``` + +### Ubuntu 14.04 LTS or 16.04 LTS +Use these instructions to upgrade APT-based systems. + +1. Update your docker-engine package: + + ```bash + $ sudo apt-get update && sudo apt-get upgrade docker-engine + ``` + +2. Check that the CS Docker Engine is running: + + ```bash + $ sudo docker info + ``` + +### SUSE Enterprise 12.3 + +1. Update your docker-engine package: + + ```bash + $ sudo zypper upgrade docker-engine + ``` + +2. Check that the CS Docker Engine is running: + + ```bash + $ sudo docker info + ``` + + +## Upgrade from the same major version + +Use these instructions if you're upgrading your CS Docker Engine within the +same major version. As an example, from 1.1.x to 1.2.x. + + +### CentOS 7.1 & RHEL 7.0/7.1/7.2 +Use these instructions to upgrade YUM-based systems. + +1. Add the Docker Engine repository. + + ```bash + $ sudo yum-config-manager --add-repo https://packages.docker.com/1.13/yum/repo/main/centos/7 + ``` + + This adds the repository of the latest version of CS Docker Engine. You can + customize the URL to install other versions. + +2. Install the new package: + + ```bash + $ sudo yum update docker-engine + ``` + +3. Check that the CS Engine is running: + + ```bash + $ sudo docker info + ``` + +### Ubuntu 14.04 LTS or 16.04 LTS +Use these instructions to update APT-based systems. + + +1. Add the docker engine repository. + + ```bash + $ echo "deb https://packages.docker.com/1.13/apt/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + ``` + + This adds the repository of the latest version of CS Docker Engine for the + Ubuntu Trusty distribution. Change the "ubuntu-trusty" string to the + distribution you're using: + + * debian-jessie (Debian 8) + * debian-stretch (future release) + * debian-wheezy (Debian 7) + * ubuntu-precise (Ubuntu 12.04) + * ubuntu-trusty (Ubuntu 14.04) + * ubuntu-xenial (Ubuntu 16.04) + +2. Update your docker-engine package. + + ```bash + $ sudo apt-get update && sudo apt-get upgrade docker-engine + ``` + +3. Check that the CS Engine is running: + + ```bash + $ sudo docker info + ``` + +#### SUSE Enterprise 12.3 + +1. Add the docker engine repository. + + ```bash + $ sudo zypper ar -t YUM https://packages.docker.com/1.13/yum/repo/main/opensuse/12.3 docker-1.13 + ``` + + This adds the repository of the latest version of CS Docker Engine. You + can customize the URL to install other versions. + +2. Install the new package: + + ```bash + $ sudo zypper update docker-engine + ``` + +3. Check that the CS Engine is running: + + ```bash + $ sudo docker info + ``` + + +## Upgrade from a legacy version + +Use these instructions if you're upgrading your CS Docker Engine from a version +prior to 1.9. In this case you'll have to first uninstall CS Docker Engine, and +then install the latest version. + +### CentOS 7.1 & RHEL 7.0/7.1 +Use these instructions to upgrade YUM-based systems. + +1. Remove the current CS Engine: + + ```bash + $ sudo yum remove docker-engine-cs + ``` + +2. Add the Docker public key for CS packages: + + ```bash + $ sudo rpm --import "https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e" + ``` + +3. Install yum-utils if necessary: + + ```bash + $ sudo yum install -y yum-utils + ``` + +4. Add the repository for the new version and disable the old one. + + ```bash + $ sudo yum-config-manager --add-repo https://packages.docker.com/1.13/yum/repo/main/centos/7 + $ sudo yum-config-manager --disable 'Docker_cs*' + ``` + + This adds the repository of the latest version of CS Docker Engine. You + can customize the URL to install other versions. + +5. Install the new package: + + ```bash + $ sudo yum install docker-engine + ``` + +6. Enable the Docker daemon as a service and start it. + + ```bash + $ sudo systemctl enable docker.service + $ sudo systemctl start docker.service + ``` + +### Ubuntu 14.04 LTS +Use these instructions to update APT-based systems. + + +1. Remove the current Engine: + + ```bash + $ sudo apt-get remove docker-engine-cs + ``` + +2. Add the Docker public key for CS packages: + + ```bash + $ curl -s 'https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e' | sudo apt-key add --import + ``` + +3. Install the HTTPS helper for apt (your system may already have it): + + ```bash + $ sudo apt-get update && sudo apt-get install apt-transport-https + ``` + +4. Install additional virtual drivers not in the base image. + + ```bash + $ sudo apt-get install -y linux-image-extra-virtual + ``` + + You may need to reboot your server after updating the LTS kernel. + +5. Add the repository for the new version: + + ```bash + $ echo "deb https://packages.docker.com/1.13/apt/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list + ``` + + This adds the repository of the latest version of CS Docker Engine for the + Ubuntu Trusty distribution. Change the "ubuntu-trusty" string to the + distribution you're using: + + * debian-jessie (Debian 8) + * debian-stretch (future release) + * debian-wheezy (Debian 7) + * ubuntu-precise (Ubuntu 12.04) + * ubuntu-trusty (Ubuntu 14.04) + * ubuntu-xenial (Ubuntu 16.04) + + + +6. Install the upgraded package: + + ```bash + $ sudo apt-get upgrade docker-engine + ``` diff --git a/css/documentation.css b/css/documentation.css index adcaa8ab94..77126d50bb 100644 --- a/css/documentation.css +++ b/css/documentation.css @@ -57,7 +57,6 @@ transition: all 0.2s ease; } - .logo { margin-top: 1px !important; width: auto !important; @@ -71,7 +70,7 @@ { list-style-type: none; width: 400px; - padding:0px; + padding: 0px 10px 0px 10px; margin-bottom: 0px; } .autoCompleteResult { @@ -517,3 +516,31 @@ img.with-border { color: #999; font-style: italic; } + +#top-nav { + float: left; +} + +#start-tour-container { + padding-top: 10px; + padding-bottom: 0; + padding-right: 0; + float: right; + vertical-align: middle; + text-align: center; +} +#start-tour { + cursor: pointer; + color: #fff; + font-family: 'Geomanist', san-serif; + font-size: 1em; + line-height: 1.3; + text-align: center; + vertical-align: middle; + width: 110px; + float: right; +} + +#start-tour:hover { + opacity: .8; +} diff --git a/css/hopscotch.css b/css/hopscotch.css new file mode 100644 index 0000000000..e840eb5d10 --- /dev/null +++ b/css/hopscotch.css @@ -0,0 +1,430 @@ +/**! hopscotch - v0.2.6 +* +* Copyright 2016 LinkedIn Corp. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); + +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http: //www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +.animated { + -webkit-animation-fill-mode: both; + -moz-animation-fill-mode: both; + -ms-animation-fill-mode: both; + -o-animation-fill-mode: both; + animation-fill-mode: both; + -webkit-animation-duration: 1s; + -moz-animation-duration: 1s; + -ms-animation-duration: 1s; + -o-animation-duration: 1s; + animation-duration: 1s; +} +@-webkit-keyframes fadeInUp { + 0% { + opacity: 0; + -webkit-transform: translateY(20px); +} +100% { + opacity: 1; + -webkit-transform: translateY(0); +} +}@-moz-keyframes fadeInUp { + 0% { + opacity: 0; + -moz-transform: translateY(20px); +} +100% { + opacity: 1; + -moz-transform: translateY(0); +} +}@-o-keyframes fadeInUp { + 0% { + opacity: 0; + -o-transform: translateY(20px); +} +100% { + opacity: 1; + -o-transform: translateY(0); +} +}@keyframes fadeInUp { + 0% { + opacity: 0; + transform: translateY(20px); +} +100% { + opacity: 1; + transform: translateY(0); +} +}.fade-in-up { + -webkit-animation-name: fadeInUp; + -moz-animation-name: fadeInUp; + -o-animation-name: fadeInUp; + animation-name: fadeInUp; +} +@-webkit-keyframes fadeInDown { + 0% { + opacity: 0; + -webkit-transform: translateY(-20px); +} +100% { + opacity: 1; + -webkit-transform: translateY(0); +} +}@-moz-keyframes fadeInDown { + 0% { + opacity: 0; + -moz-transform: translateY(-20px); +} +100% { + opacity: 1; + -moz-transform: translateY(0); +} +}@-o-keyframes fadeInDown { + 0% { + opacity: 0; + -ms-transform: translateY(-20px); +} +100% { + opacity: 1; + -ms-transform: translateY(0); +} +}@keyframes fadeInDown { + 0% { + opacity: 0; + transform: translateY(-20px); +} +100% { + opacity: 1; + transform: translateY(0); +} +}.fade-in-down { + -webkit-animation-name: fadeInDown; + -moz-animation-name: fadeInDown; + -o-animation-name: fadeInDown; + animation-name: fadeInDown; +} +@-webkit-keyframes fadeInRight { + 0% { + opacity: 0; + -webkit-transform: translateX(-20px); +} +100% { + opacity: 1; + -webkit-transform: translateX(0); +} +}@-moz-keyframes fadeInRight { + 0% { + opacity: 0; + -moz-transform: translateX(-20px); +} +100% { + opacity: 1; + -moz-transform: translateX(0); +} +}@-o-keyframes fadeInRight { + 0% { + opacity: 0; + -o-transform: translateX(-20px); +} +100% { + opacity: 1; + -o-transform: translateX(0); +} +}@keyframes fadeInRight { + 0% { + opacity: 0; + transform: translateX(-20px); +} +100% { + opacity: 1; + transform: translateX(0); +} +}.fade-in-right { + -webkit-animation-name: fadeInRight; + -moz-animation-name: fadeInRight; + -o-animation-name: fadeInRight; + animation-name: fadeInRight; +} +@-webkit-keyframes fadeInLeft { + 0% { + opacity: 0; + -webkit-transform: translateX(20px); +} +100% { + opacity: 1; + -webkit-transform: translateX(0); +} +}@-moz-keyframes fadeInLeft { + 0% { + opacity: 0; + -moz-transform: translateX(20px); +} +100% { + opacity: 1; + -moz-transform: translateX(0); +} +}@-o-keyframes fadeInLeft { + 0% { + opacity: 0; + -o-transform: translateX(20px); +} +100% { + opacity: 1; + -o-transform: translateX(0); +} +}@keyframes fadeInLeft { + 0% { + opacity: 0; + transform: translateX(20px); +} +100% { + opacity: 1; + transform: translateX(0); +} +}.fade-in-left { + -webkit-animation-name: fadeInLeft; + -moz-animation-name: fadeInLeft; + -o-animation-name: fadeInLeft; + animation-name: fadeInLeft; +} +div.hopscotch-bubble .hopscotch-nav-button { + font-weight: 900; + cursor: pointer; + margin: 0; + overflow: visible; + text-decoration: none!important; + width: auto; + padding: 0 10px; + height: 26px; + line-height: 24px; + font-size: 12px; + display: -moz-inline-stack; + display: inline-block; + *vertical-align: auto; + vertical-align: middle; +} + +div.hopscotch-bubble .hopscotch-nav-button.next, +div.hopscotch-bubble .hopscotch-nav-button.prev { + background-color: #fff; + margin: 0 0 0 10px; +} + +div.hopscotch-bubble .hopscotch-nav-button.next:hover, +div.hopscotch-bubble .hopscotch-nav-button.prev:hover { + opacity: .8; +} + +div.hopscotch-bubble .hopscotch-nav-button.next { + color: #0087c9; + border: 2px solid #0087c9; +} + +div.hopscotch-bubble .hopscotch-nav-button.prev { + color: #999; + border: 2px solid #999; +} + + +div.hopscotch-bubble { + background-color: #fff; + border: 5px solid #000; + border: 5px solid rgba(0, 0, 0, .5); + color: #333; + font-family: Helvetica, Arial; + font-size: 13px; + position: absolute; + z-index: 999999; + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; + -moz-background-clip: padding; + -webkit-background-clip: padding; + background-clip: padding-box; +} +div.hopscotch-bubble * { + -webkit-box-sizing: content-box; + -moz-box-sizing: content-box; + box-sizing: content-box; +} +div.hopscotch-bubble.animate { + -moz-transition-property: top, left; + -moz-transition-duration: 1s; + -moz-transition-timing-function: ease-in-out; + -ms-transition-property: top, left; + -ms-transition-duration: 1s; + -ms-transition-timing-function: ease-in-out; + -o-transition-property: top, left; + -o-transition-duration: 1s; + -o-transition-timing-function: ease-in-out; + -webkit-transition-property: top, left; + -webkit-transition-duration: 1s; + -webkit-transition-timing-function: ease-in-out; + transition-property: top, left; + transition-duration: 1s; + transition-timing-function: ease-in-out; +} +div.hopscotch-bubble.invisible { + opacity: 0; +} +div.hopscotch-bubble.hide, div.hopscotch-bubble .hide, div.hopscotch-bubble .hide-all { + display: none; +} +div.hopscotch-bubble h3 { + color: #000; + font-family: Helvetica, Arial; + font-size: 16px; + font-weight: 700; + line-height: 19px; + margin: -1px 15px 0 0; + padding: 0; +} +div.hopscotch-bubble .hopscotch-bubble-container { + padding: 15px; + position: relative; + text-align: left; + -webkit-font-smoothing: antialiased; +} +div.hopscotch-bubble .hopscotch-content { + font-family: Helvetica, Arial; + font-size: 16px; + font-weight: 400; + line-height: 17px; + margin: -5px 0 11px; + padding-top: 8px; +} +div.hopscotch-bubble .hopscotch-bubble-content { + margin: 0 0 0 40px; + padding: 5px; +} + +div.hopscotch-bubble.no-number .hopscotch-bubble-content { + margin: 0; +} +div.hopscotch-bubble .hopscotch-bubble-close { + border: 0; + background-color: #fff; + display: block; + padding: 8px; + padding-top: 0; + position: absolute; + text-decoration: none; + width: 8px; + height: 8px; + top: 0; + right: 0; + color: #333; + font-weight: bold; +} + +div.hopscotch-bubble .hopscotch-bubble-close:hover { + opacity: .8; +} + +div.hopscotch-bubble .hopscotch-bubble-close.hide, div.hopscotch-bubble .hopscotch-bubble-close.hide-all { + display: none; +} +div.hopscotch-bubble .hopscotch-bubble-number { + border-radius: 50%; + behavior: url(PIE.htc); + width: 30px; + height: 30px; + padding: 2px; + border: 2px solid #0087c9; + color: #0a486b; + text-align: center; + float: left; + font-size: 1.3rem; + margin-right: 7px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container { + position: absolute; + width: 34px; + height: 34px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container .hopscotch-bubble-arrow, div.hopscotch-bubble .hopscotch-bubble-arrow-container .hopscotch-bubble-arrow-border { + width: 0; + height: 0; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.up { + top: -22px; + left: 10px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.up .hopscotch-bubble-arrow { + border-bottom: 17px solid #fff; + border-left: 17px solid transparent; + border-right: 17px solid transparent; + position: relative; + top: -10px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.up .hopscotch-bubble-arrow-border { + border-bottom: 17px solid #000; + border-bottom: 17px solid rgba(0, 0, 0, .5); + border-left: 17px solid transparent; + border-right: 17px solid transparent; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.down { + bottom: -39px; + left: 10px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.down .hopscotch-bubble-arrow { + border-top: 17px solid #fff; + border-left: 17px solid transparent; + border-right: 17px solid transparent; + position: relative; + top: -24px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.down .hopscotch-bubble-arrow-border { + border-top: 17px solid #000; + border-top: 17px solid rgba(0, 0, 0, .5); + border-left: 17px solid transparent; + border-right: 17px solid transparent; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.left { + top: 10px; + left: -22px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.left .hopscotch-bubble-arrow { + border-bottom: 17px solid transparent; + border-right: 17px solid #fff; + border-top: 17px solid transparent; + position: relative; + left: 7px; + top: -34px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.left .hopscotch-bubble-arrow-border { + border-right: 17px solid #000; + border-right: 17px solid rgba(0, 0, 0, .5); + border-bottom: 17px solid transparent; + border-top: 17px solid transparent; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.right { + top: 10px; + right: -39px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.right .hopscotch-bubble-arrow { + border-bottom: 17px solid transparent; + border-left: 17px solid #fff; + border-top: 17px solid transparent; + position: relative; + left: -7px; + top: -34px; +} +div.hopscotch-bubble .hopscotch-bubble-arrow-container.right .hopscotch-bubble-arrow-border { + border-left: 17px solid #000; + border-left: 17px solid rgba(0, 0, 0, .5); + border-bottom: 17px solid transparent; + border-top: 17px solid transparent; +} +div.hopscotch-bubble .hopscotch-actions { + margin: 10px 0 0; + text-align: right; +} diff --git a/datacenter/dtr/2.0/index.md b/datacenter/dtr/2.0/index.md index e55dd04332..c1e75a58a8 100644 --- a/datacenter/dtr/2.0/index.md +++ b/datacenter/dtr/2.0/index.md @@ -1,10 +1,6 @@ --- description: Learn how to install, configure, and use Docker Trusted Registry. keywords: docker, registry, repository, images -redirect_from: -- /docker-hub-enterprise/ -- /docker-trusted-registry/overview/ -- /docker-trusted-registry/ title: Docker Trusted Registry overview --- @@ -39,4 +35,4 @@ access to your Docker images. ## Where to go next * [DTR architecture](architecture.md) -* [Install DTR](install/index.md) \ No newline at end of file +* [Install DTR](install/index.md) diff --git a/datacenter/dtr/2.1/guides/high-availability/index.md b/datacenter/dtr/2.1/guides/high-availability/index.md index 67126e1332..130bf8a716 100644 --- a/datacenter/dtr/2.1/guides/high-availability/index.md +++ b/datacenter/dtr/2.1/guides/high-availability/index.md @@ -34,11 +34,15 @@ the DTR cluster. When sizing your DTR installation for high-availability, follow these rules of thumb: -* Don't create a DTR cluster with just two replicas. Your cluster -won't tolerate any failures, and it's possible that you experience performance -degradation. +* Don't create a DTR cluster with an even number replicas. Your cluster +won't tolerate any failures if the cluster splits in half. This is +very difficult to recover from. * When a replica fails, the number of failures tolerated by your cluster decreases. Don't leave that replica offline for long. +* When you want to fix your DTR cluster, make certain that you remove any +broken replicas before you try to add a new replica. The DTR bootstrapper +will try to prevent you from doing this, as it could lead to multiple +failed nodes and failure of the entire DTR cluster. * Adding too many replicas to the cluster might also lead to performance degradation, as data needs to be replicated across all replicas. @@ -64,6 +68,23 @@ To have high-availability on UCP and DTR, you need a minimum of: ![](../images/high-availability-2.png) +## Storage considerations + +DTR does not provide clustering for the storage which underlies your image +repositories. In order for DTR to work correctly in HA mode, you will either +need to use object storage or NFS. + +Supported object stores include: + +* AWS S3 +* Azure Cloud Storage +* OpenStack Swift +* Google Cloud Storage +* S3 Compatible storage (Scality, Minio, etc.) + +Object storage can be configured directly through the Admin screen in the +DTR UI, and NFS can be configured during installation through the CLI. + ## Load balancing DTR does not provide a load balancing service. You can use an on-premises diff --git a/datacenter/dtr/2.1/guides/install/index.md b/datacenter/dtr/2.1/guides/install/index.md index 0f30232e48..e5fc61b3a0 100644 --- a/datacenter/dtr/2.1/guides/install/index.md +++ b/datacenter/dtr/2.1/guides/install/index.md @@ -72,7 +72,7 @@ browser, navigate to the address were you installed DTR. After installing DTR, you should configure: * The certificates used for TLS communication. [Learn more](../configure/index.md). - * The storage backend to store the Docker images. [Lean more](../configure/configure-storage.md). + * The storage backend to store the Docker images. [Learn more](../configure/configure-storage.md). To perform these configurations, navigate to the **Settings** page of DTR. diff --git a/datacenter/dtr/2.2/guides/admin/backups-and-disaster-recovery.md b/datacenter/dtr/2.2/guides/admin/backups-and-disaster-recovery.md new file mode 100644 index 0000000000..c45be78842 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/backups-and-disaster-recovery.md @@ -0,0 +1,128 @@ +--- +description: Learn how to back up your Docker Trusted Registry cluster, and to recover your cluster from an existing backup. +keywords: docker, registry, high-availability, backup, recovery +title: DTR backups and recovery +--- + +When you use Docker Trusted Registry on a production setting, you should first +configure it for high availability. + +The next step is creating a backup policy and disaster recovery plan. + +## DTR data persistence + +Docker Trusted Registry persists: + +* **Configurations**: the cluster configurations are stored on a key-value store +that is replicated through all DTR replicas. +* **Repository metadata**: the information about the repositories and +images deployed. This information is replicated through all DTR replicas. +* **Certificates and keys**: the certificates, public keys, and private keys +that are used for mutual TLS communication. + +This data persists using named volumes on the host where DTR is running. +[Learn more about DTR named volumes](../architecture.md). + +DTR also persists Docker images on the filesystem of the host running DTR, or +on a cloud provider, depending on the way DTR is configured. + +## Backup DTR data + +To perform a backup of a DTR node, use the `backup` command. This +command creates a backup of DTR: + +* Configurations, +* Repository metadata, +* Certificates and keys used by DTR. + +These files are added to a tar archive, and the result is streamed to stdout. + +The backup command does not create a backup of Docker images. You should +implement a separate backup policy for the Docker images, taking in +consideration whether your DTR installation is configured to store images on the +filesystem or using a cloud provider. + +The backup command also doesn't create a backup of the users and organizations. +That data is managed by UCP, so when you create a UCP backup you're creating +a backup of the users and organizations metadata. + +When creating a backup, the resulting .tar file contains sensitive information +like private keys. You should ensure the backups are stored securely. + +You can check the +[reference documentation](../../reference/cli/backup.md), for the +backup command to learn about all the available flags. + +As an example, to create a backup of a DTR node, you can use: + +```none +$ docker run -i --rm docker/dtr backup \ + --ucp-url \ + --ucp-insecure-tls \ + --existing-replica-id \ + --ucp-username \ + --ucp-password > /tmp/backup.tar +``` + +Where: + +* `--ucp-url` is the address of UCP, +* `--ucp-insecure-tls` is to trust the UCP TLS certificate, +* `--existing-replica-id` is the id of the replica to backup, +* `--ucp-username`, and `--ucp-password` are the credentials of a UCP administrator. + +To validate that the backup was correctly performed, you can print the contents +of the tar file created: + +```none +$ tar -tf /tmp/backup.tar +``` + +## Restore DTR data + +You can restore a DTR node from a backup using the `restore` +command. +This command performs a fresh installation of DTR, and reconfigures it with +the configuration created during a backup. + +The command starts by installing DTR, restores the configurations stored on +etcd, and then restores the repository metadata stored on RethinkDB. You +can use the `--config-only` option, to only restore the configurations stored +on etcd. + +This command does not restore Docker images. You should implement a separate +restore procedure for the Docker images stored in your registry, taking in +consideration whether your DTR installation is configured to store images on +the filesystem or using a cloud provider. + +You can check the +[reference documentation](../../reference/cli/backup.md), for the +backup command to learn about all the available flags. + + +As an example, to install DTR on the host and restore its +state from an existing backup: + +```none +# Install and restore configurations from an existing backup +$ docker run -i --rm \ + docker/dtr restore \ + --ucp-url \ + --ucp-insecure-tls \ + --ucp-username \ + --ucp-password \ + --dtr-load-balancer < /tmp/backup.tar +``` + +Where: + +* `--ucp-url` is the address of UCP, +* `--ucp-insecure-tls` is to trust the UCP TLS certificate, +* `--ucp-username`, and `--ucp-password` are the credentials of a UCP administrator, +* `--dtr-load-balancer` is the domain name or ip where DTR can be reached. + + +## Where to go next + +* [Set up high availability](configure/set-up-high-availability.md) +* [DTR architecture](../architecture.md) diff --git a/datacenter/dtr/2.2/guides/admin/configure/create-and-manage-orgs.md b/datacenter/dtr/2.2/guides/admin/configure/create-and-manage-orgs.md new file mode 100644 index 0000000000..7dfbfb8b88 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/configure/create-and-manage-orgs.md @@ -0,0 +1,49 @@ +--- +description: Learn how to set up organizations to enforce security in Docker Trusted + Registry. +keywords: docker, registry, security, permissions, organizations +title: Create and manage organizations in DTR +--- + + + +When a user creates a repository, only that user has permissions to make changes +to the repository. + +For team workflows, where multiple users have permissions to manage a set of +common repositories, create an organization. By default, DTR has one +organization called 'docker-datacenter', that is shared between DTR and UCP. + +To create a new organization, navigate to the **DTR web UI**, and go to the +**Organizations** page. + +![](../images/create-and-manage-orgs-1.png) + +Click the **New organization** button, and choose a meaningful name for the +organization. + +![](../images/create-and-manage-orgs-2.png) + +Repositories owned by this organization will contain the organization name, so +to pull an image from that repository, you'll use: + +```bash +$ docker pull //: +``` + +Click **Save** to create the organization, and then **click the organization** +to define which users are allowed to manage this +organization. These users will be able to edit the organization settings, edit +all repositories owned by the organization, and define the user permissions for +this organization. + +For this, click the **Add user** button, **select the users** that you want to +grant permissions to manage the organization, and click +**Save**. Then change their permissions from 'Member' to **Admin**. + +![](../images/create-and-manage-orgs-3.png) + +## Where to go next + +* [Create and manage users](create-and-manage-users.md) +* [Create and manage teams](create-and-manage-teams.md) diff --git a/datacenter/dtr/2.2/guides/admin/configure/deploy-a-cache.md b/datacenter/dtr/2.2/guides/admin/configure/deploy-a-cache.md new file mode 100644 index 0000000000..5267e1b186 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/configure/deploy-a-cache.md @@ -0,0 +1,235 @@ +--- +title: Cache Docker images +description: Learn how to configure DTR to have caching and making pulls faster. +keywords: docker, registry, dtr, cache +--- + +You can configure DTR to have multiple caches. Users can then configure their +DTR user accounts to specify which cache to pull from. This way users can +pull Docker images from a cache that is geographically closer to them or +that allows them faster downloads. + +## How DTR caches works + +You start by deploying one or more DTR caches. + +![](../../images/cache-docker-images-1.svg) + +Since caches have to contact DTR for authorizing user requests, and requests +are chained from one cache to the next until the request reaches DTR, you +should avoid creating cache trees that have more than two levels. This can +make the image pull slower than having no cache at all. + +After you've deployed the caches, users can configure which cache to +pull from on their DTR user profile page. This allows users to choose which +cache to use for faster image pulls. + +In this example, users can go to their DTR profile page, and configure their +user account to use the US cache. Then, when using the +`docker pull //` command to pull an image, the +following happens: + +1. The Docker client makes a request to DTR which in turn authenticates the +request +2. The Docker client requests the image manifest to DTR. This ensures that +users will always pull the correct image, and not an outdated version +3. The Docker client requests the layer blobs to DTR, which redirects the +request to the cache configured by the user +4. If the blob exists on the cache it is sent to the user. Otherwise, the cache +pulls it from DTR and sends it to the user + +When a user pushes an image, that image is only available in DTR. A cache +will only store the image when a user tries to pull the image using that cache. + + +## Deploy a DTR cache + +You can deploy a DTR cache on any host that has Docker installed. The only +requirements are that: + +* Users need to have access to both DTR and the cache +* The cache needs access to DTR + +Log into the host using ssh, and create a `config.yml` file with the following +content: + +``` +version: 0.1 +storage: + delete: + enabled: true + filesystem: + rootdirectory: /var/lib/registry +http: + addr: :5000 +middleware: + registry: + - name: downstream + options: + blobttl: 24h + upstreams: + - originhost: https:// + cas: + - /certs/dtr-ca.pem +``` + +This configures the cache to store the images in the directory +`/var/lib/registry`, exposes the cache service on port 5000, and configures the +cache to delete images that are not pulled in the last 24 hours. It also +defines where DTR can be reached, and which CA certificates should be trusted. + +Now we need to download the CA certificate used by DTR. For this, run: + +``` +curl -k https:///ca > dtr-ca.pem +``` + +Now that we've got the cache configuration file and DTR CA certificate, we can +deploy the cache by running: + +```none +docker run --detach --restart always \ + --name content-cache \ + --publish 5000:5000 \ + --volume $(pwd)/dtr-ca.pem:/certs/dtr-ca.pem \ + --volume $(pwd)/config.yml:/config.yml \ + docker/dtr-content-cache: /config.yml +``` + +You can also run the command in interactive mode instead of detatched by +replacing `--detached` with `--interactive`. This allows you to +see the logs generated by the container and troubleshoot misconfigurations. + +Now that you've deployed a cache, you need to configure DTR to know about it. +This is done using the `POST /api/v0/content_caches` API. You can use the +DTR interactive API documentation to use this API. + +In the DTR web UI, click the top-right menu, and choose **API docs**. + +![](../../images/cache-docker-images-2.png){: .with-border} + +Navigate to the `POST /api/v0/content_caches` line and click it to expand. +In the **body** field include: + +``` +{ + "name": "region-us", + "host": "http://:5000" +} +``` + +Click the **Try it out!** button to make the API call. + +![](../../images/cache-docker-images-3.png){: .with-border} + +DTR knows about the cache we've created, so we just need to configure our DTR +user settings to start using that cache. + +In the DTR web UI, navigate to your **user profile**, click the **Settings** +tab, and change the **Content cache** settings to use the **region-us** cache. + +![](../../images/cache-docker-images-4.png){: .with-border} + +Now when you pull images, you'll be using the cache. To test this, try pulling +an image from DTR. You can inspect the logs of the cache service, to validate +that the cache is being used, and troubleshoot problems. + +In the host where you've deployed the `region-us` cache, run: + +``` +docker logs content-cache +``` + + +## Configure the cache + +The DTR cache is based on Docker Registry, and uses the same configuration +file format. +[Learn more about the configuration options](/registry/configuration.md). + +The DTR cache extends the Docker Registry configuration file format by +introducing a new middleware called `downstream` that has three configuration +options: `blobttl`, `upstreams`, and `cas`: + +```none +# Settings that you would include in a +# Docker Registry configuration file followed by + +middleware: + registry: + - name: downstream + options: + blobttl: 24h + upstreams: + - originhost: + upstreamhosts: + - + - + cas: + - + - +``` + +Below you can find the description for each DTR cache-specific parameter. + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterRequiredDescription
+ blobttl + + no + +The TTL for blobs in the cache. This field takes a positive integer and an optional suffix indicating the unit of time. If +this field is configured, "storage.delete.enabled" must be configured to true. Possible units are: +
    +
  • ns (nanoseconds)
  • +
  • us (microseconds)
  • +
  • ms (milliseconds)
  • +
  • s (seconds)
  • +
  • m (minutes)
  • +
  • h (hours)
  • +
+ If you omit the suffix, the system interprets the value as nanoseconds. +
+ cas + + no + + A list of absolute paths to PEM-encoded CA certificates of upstream registries. +
+ originhost + + yes + + An externally-reachable address for the origin registry, as a fully qualified URL. +
+ upstreamhosts + + no + + A list of externally-reachable addresses for upstream registries for cache chaining. If more than one host is specified, pulls from upstream content caches will be done in round-robin order. +
diff --git a/datacenter/dtr/2.2/guides/admin/configure/external-storage/index.md b/datacenter/dtr/2.2/guides/admin/configure/external-storage/index.md new file mode 100644 index 0000000000..876fce297b --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/configure/external-storage/index.md @@ -0,0 +1,199 @@ +--- +description: Storage configuration for Docker Trusted Registry +keywords: docker, documentation, about, technology, understanding, configuration, + storage, storage drivers, Azure, S3, Swift, enterprise, hub, registry +title: Configure DTR image storage +--- + +After installing Docker Trusted Registry, one of your first tasks is to +designate and configure the Trusted Registry storage backend. This document provides the following: + +* Information describing your storage backend options. +* Configuration steps using either the Trusted Registry UI or a YAML file. + +While there is a default storage backend, `filesystem`, the Trusted Registry offers other options that are cloud-based. This flexibility to configure to a different storage backend allows you to: + +* Scale your Trusted Registry +* Leverage storage redundancy +* Store your images anywhere in the cloud +* Take advantage of other features that are critical to your organization + +At first, you might have explored Docker Trusted Registry and Docker Engine by +installing +them on your system in order to familiarize yourself with them. +However, for various reasons such as deployment purposes or continuous +integration, it makes sense to think about your long term organization’s needs +when selecting a storage backend. The Trusted Registry natively supports TLS and +basic authentication. + +## Understand the Trusted Registry storage backend + +By default, your Trusted Registry data resides as a data volume on the host +`filesystem`. This is where your repositories and images are stored. This +storage driver is the local posix `filesystem` and is configured to use a +directory tree in the local filesystem. It's suitable for development or small +deployments. The `filesystem` can be located on the same computer as the Trusted Registry, or on a separate system. + +Additionally, the Trusted Registry supports these cloud-based storage drivers: + +* Amazon Simple Storage Solution **S3** +* OpenStack **Swift** +* Microsoft **Azure** Blob Storage + + +### Filesystem + +If you select `filesystem`, then the Trusted Registry uses the local disk to +store registry files. This backend has a single, required `rootdirectory` +parameter which specifies a subdirectory of `/var/local/dtr/imagestorage` in +which all registry files are stored. The default value of `/local` means the +files are stored in `/var/local/dtr/image-storage/local`. + +The Trusted Registry stores all its data at this location, so ensure there is +adequate space available. To do so, you can run the following commands: + +* To analyze the disk usage: `docker exec -it bash` then run `df -h`. +* To see the file size of your containers, use the `-s` argument of `docker ps -s`. + +### Amazon S3 + +S3 stores data as objects within “buckets” where you read, write, and delete +objects in that container. It too, has a `rootdirectory` parameter. If you select this option, there will be some tasks that you need to first perform [on AWS](https://aws.amazon.com/s3/getting-started/). + +1. You must create an S3 bucket, and write down its name and the AWS zone it +runs on. +2. Determine write permissions for your bucket. +3. S3 flavor comes with DEBUG=false by default. If you need to debug, then you need to add `-e DEBUG=True`. +4. Specify an AWS region, which is dependent on your S3 location, for example, use `-e AWS_REGION=”eu-west-1”`. +5. Ensure your host time is correct. If your host clock is still running on the main computer, but not on the docker host virtual machine, then you will have +time differences. This may cause an issue if you try to authenticate with Amazon +web services. +6. You will also need your AWS access key and secret key. Learn [more about it ](http://docs.aws.amazon.com/general/latest/gr/managing-aws-access-keys.html) here. + +Conversely, you can further limit what users access in the Trusted Registry when you use AW to host your Trusted Registry. Instead of using the UI to enter information, you can create an [IAM user policy](http://docs.aws.amazon.com/AmazonS3/latest/dev/example-policies-s3.html) which is a JSON description of the effects, actions, and resources available to +a user. The advantage of using this method instead of configuring through the Trusted Registry UI is that you can restrict what users can access. You apply the policy as part of the process of installing the Trusted Registry on AW. To set a policy through the AWS command line, save the policy into a file, +for example `TrustedRegistryUserPerms.json`, and pass it to the +put-user-policy AWS command: + +``` +$ aws iam put-user-policy --user-name MyUser --policy-name TrustedRegistryUserPerms --policy-document file://C:\Temp\TrustedRegistryUserPerms.json +``` + +You can also set a policy through your AWS console. For more information about +setting IAM policies using the command line or the console, review the AWS +[Overview of IAM Policies](http://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies.html) article or visit the console Policies page. + +The following example describes the minimum permissions set which allows +Trusted Registry users to access, push, pull, and delete images. + +```json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": "s3:ListAllMyBuckets", + "Resource": "arn:aws:s3:::*" + }, + { + "Effect": "Allow", + "Action": [ + "s3:ListBucket", + "s3:GetBucketLocation" + ], + "Resource": "arn:aws:s3:::" + }, + { + "Effect": "Allow", + "Action": [ + "s3:PutObject", + "s3:GetObject", + "s3:DeleteObject" + ], + "Resource": "arn:aws:s3:::/*" + } + ] +} + +``` + +### OpenStack Swift + +OpenStack Swift, also known as OpenStack Object Storage, is an open source +object storage system that is licensed under the Apache 2.0 license. Refer to [Swift documentation](http://docs.openstack.org/developer/swift/) to get started. + + +### Microsoft Azure + +This storage backend uses Microsoft’s Azure Blob storage. Data is stored within +a paid Windows Azure storage account. Refer to Microsoft's Azure +[documentation](https://azure.microsoft.com/en-us/services/storage/) which +explains how to set up your Storage account. + +## Configure your Trusted Registry storage backend + +Once you select your driver, you need to configure it through the UI or use a +YAML file (which is discussed further in this document.) + +1. From the main Trusted Registry screen, navigate to Settings > Storage. +2. Under Storage Backend, use the drop down menu to select your storage. The screen refreshes to reflect your option. +3. Enter your configuration settings. If you're not sure what a particular parameter does, then find your driver from the following headings so that you can see a detailed explanation. +4. Click Save. The Trusted Registry restarts so that your changes take effect. + +>**Note**: Changing your storage backend requires you to restart the Trusted Registry. + +See the [Registry configuration](/registry/configuration.md) +documentation for the full options specific to each driver. Storage drivers can +be customized through the [Docker Registry storage driver +API](/registry/storage-drivers/index.md#storage-driver-api). + + +### Filesystem settings + +The [filesystem storage backend](/registry/configuration.md#filesystem) +has only one setting, the "Storage directory". + +### S3 settings + +If you select the [S3 storage backend](/registry/configuration.md#s3), then you +need to set "AWS region", "Bucket name", "Access Key", and "Secret Key". + +### Azure settings + +Set the "Account name", "Account key", "Container", and "Realm" on the [Azure storage backend](/registry/configuration.md#azure) page. + +### Openstack Swift settings + +View the [Openstack Swift settings](/registry/configuration.md#openstack-swift) +documentation so that you can set up your storage settings: authurl, username, +password, container, tenant, tenantid, domain, domainid, insecureskipverify, +region, chunksize, and prefix. + +## Configure using a YAML file + +If the previous quick setup options are not sufficient to configure your +Registry options, you can upload a YAML file. The schema of this file is +identical to that used by the [Registry](/registry/configuration.md). + +There are several benefits to using a YAML file as it can provide an +additional level of granularity in defining your storage backend. Advantages +include: + +* Overriding specific configuration options. +* Overriding the entire configuration file. +* Selecting from the entire list of configuration options. + +**To configure**: + +1. Navigate to the Trusted Registry UI > Settings > Storage. +2. Select Download to get the text based file. It contains a minimum amount +of information and you're going to need additional data based on your driver and +business requirements. +3. Go [here](/registry/configuration.md#list-of-configuration-options") to see the open source YAML file. Copy the sections you need and paste into your `storage.yml` file. Note that some settings may contradict others, so +ensure your choices make sense. +4. Save the YAML file and return to the UI. +5. On the Storage screen, upload the file, review your changes, and click Save. + +## Where to go next + +* [Set up high availability](../set-up-high-availability.md) diff --git a/datacenter/dtr/2.2/guides/admin/configure/external-storage/nfs.md b/datacenter/dtr/2.2/guides/admin/configure/external-storage/nfs.md new file mode 100644 index 0000000000..e48edae89f --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/configure/external-storage/nfs.md @@ -0,0 +1,73 @@ +--- +title: Use NFS +description: Learn how to integrate Docker Trusted Registry with NFS +keywords: registry, dtr, storage, nfs +--- + + + +You can configure DTR to store Docker images in an NFS directory. + +Before installing or configuring DTR to use an NFS directory, make sure that: + +* The NFS server has been correctly configured +* The NFS server has a fixed IP address +* All hosts running DTR have the correct NFS libraries installed + + +To confirm that the hosts can connect to the NFS server, try to list the +directories exported by your NFS server: + +```bash +showmount -e +``` + +You should also try to mount one of the exported directories: + +```bash +mkdir /tmp/mydir && sudo mount -t nfs : +``` + +## Install DTR with NFS + +One way to configure DTR to use an NFS directory is at install time: + +```none +docker run -it --rm docker/dtr install \ + --nfs-storage-url \ + +``` + +The NFS storage URL should be in the format `nfs:///`. + +When you join replicas to the DTR cluster, the replicas will pick up that +configuration, so you don't need to specify it again. + +### Reconfigure DTR to use NFS + +If you're upgrading from a previous version of DTR and are already using +NFS you can continue using the same configurations. + +If you want to start using the new DTR built-in support for NFS you can +reconfigure DTR: + +```none +docker run -it --rm docker/dtr reconfigure \ + --nfs-storage-url +``` + +If you want to reconfigure DTR to stop using NFS storage, leave the option +in blank: + +```none +docker run -it --rm docker/dtr reconfigure \ + --nfs-storage-url "" +``` + +If the IP address of your NFS server changes, even if the DNS address is kept +the same, you should reconfigure DTR to stop using NFS storage, and then +add it back again. + +## Where to go next + +* [Configure where images are stored](configure-storage.md) diff --git a/datacenter/dtr/2.2/guides/admin/configure/license-your-installation.md b/datacenter/dtr/2.2/guides/admin/configure/license-your-installation.md new file mode 100644 index 0000000000..c3cb201a3b --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/configure/license-your-installation.md @@ -0,0 +1,39 @@ +--- +title: License your installation +description: Learn how to license your Docker Trusted Registry installation. +keywords: docker, dtr, install, license +--- + +By default, you don't need to license your Docker Trusted Registry. When +installing DTR, it automatically starts using the same license file used on +your Docker Universal Control Plane cluster. + +However, there are some situations when you have to manually license your +DTR installation: + +* When upgrading to a new major version, +* When your current license expires. + + +## Download your license + +Go to [Docker Store](https://store.docker.com/bundles/docker-datacenter) and +download your license. + +![](../../images/license-1.png) + + +## License your installation + +Once you've downloaded the license file, you can apply it to your DTR +installation. Navigate to the **DTR web UI**, and then go to the **Settings +page**. + +![](../../images/license-2.png) + +Click the **Apply new license** button, and upload your new license file. + + +## Where to go next + +* [Use your own TLS certificates](use-your-own-tls-certificates.md) diff --git a/datacenter/dtr/2.2/guides/admin/configure/set-up-high-availability.md b/datacenter/dtr/2.2/guides/admin/configure/set-up-high-availability.md new file mode 100644 index 0000000000..7bac291365 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/configure/set-up-high-availability.md @@ -0,0 +1,89 @@ +--- +title: Set up high availability +description: Lean how to scale Docker Trusted Registry by adding and removing replicas. +keywords: docker, dtr, install, deploy +--- + +Docker Trusted Registry is designed to scale horizontally as your usage +increases. You can add more replicas to make DTR scale to your demand and for +high availability. + +All DTR replicas run the same set of services and changes to their configuration +are automatically propagated to other replicas. + +![](../../images/set-up-high-availability-1.svg) + +To make DTR tolerant to failures, add additional replicas to the DTR cluster. + +| DTR replicas | Failures tolerated | +|:------------:|:------------------:| +| 1 | 0 | +| 3 | 1 | +| 5 | 2 | +| 7 | 3 | + + +When sizing your DTR installation for high-availability, +follow these rules of thumb: + +* Don't create a DTR cluster with just two replicas. Your cluster +won't tolerate any failures, and it's possible that you experience performance +degradation. +* When a replica fails, the number of failures tolerated by your cluster +decreases. Don't leave that replica offline for long. +* Adding too many replicas to the cluster might also lead to performance +degradation, as data needs to be replicated across all replicas. + +To have high-availability on UCP and DTR, you need a minimum of: + +* 3 dedicated nodes to install UCP with high availability, +* 3 dedicated nodes to install DTR with high availability, +* As many nodes as you want for running your containers and applications. + +## Join more DTR replicas + +To add replicas to an existing DTR deployment: + +1. Use ssh to log into any node that is already part of UCP. + +2. Run the DTR join command: + + ```none + docker run -it --rm \ + {{ page.docker_image }} join \ + --ucp-node \ + --ucp-insecure-tls + ``` + + Where the `--ucp-node` is the hostname of the UCP node where you want to + deploy the DTR replica. `--ucp-insecure-tls` tells the command to trust the + certificates used by UCP. + +3. If you have a load balancer, add this DTR replica to the load balancing pool. + +## Remove existing replicas + +To remove a DTR replica from your deployment: + +1. Use ssh to log into any node that is part of UCP. +2. Run the DTR remove command: + +```none +docker run -it --rm \ + {{ page.docker_image }} remove \ + --ucp-insecure-tls +``` + +You will be prompted for: + +* Existing replica id: the id of any healthy DTR replica of that cluster +* Replica id: the id of the DTR replica you want to remove. It can be the id of an +unhealthy replica +* UCP username and password: the administrator credentials for UCP + +If you're load-balancing user requests across multiple DTR replicas, don't +forget to remove this replica from the load balancing pool. + +## Where to go next + +* [Set up vulnerability scans](set-up-vulnerability-scans.md) diff --git a/datacenter/dtr/2.2/guides/admin/configure/set-up-vulnerability-scans.md b/datacenter/dtr/2.2/guides/admin/configure/set-up-vulnerability-scans.md new file mode 100644 index 0000000000..e79e0177ad --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/configure/set-up-vulnerability-scans.md @@ -0,0 +1,181 @@ +--- +description: Enable and configure Docker Security Scanning for Docker Trusted Registry. +keywords: docker, registry, scanning, security scan, vulnerability, CVE +title: Set up Security Scanning in DTR +--- + +This page explains how to set up and enable Docker Security Scanning on an existing installation of Docker Trusted Registry. + +## Prerequisites + +These instructions assume that you have already installed Docker Trusted +Registry, and have access to an account on the DTR instance with administrator +access. + +Before you begin, make sure that you or your organization has purchased a DTR +license that includes Docker Security Scanning, and that your Docker ID can +access and download this license from the Docker Store. + +If you are using a license associated with an individual account, no additional +action is needed. If you are using a license associated with an organization +account, you may need to make sure your Docker ID is a member of the `Owners` +team. Only `Owners` team members can download license files for an Organization. + +If you will be allowing the Security Scanning database to update itself +automatically, make sure that the server hosting your DTR instance can access +`https://dss-cve-updates.docker.com/` on the standard https port 443. + +## Get the security scanning license. + +If your DTR instance already has a license that includes Security Scanning, skip +this step and proceed to [enable DTR Security Scanning](#enable-dtr-security-scanning). + +> **Tip**: To check if your existing DTR license includes scanning, navigate to the DTR **Settings** page, and click **Security**. If an "Enable scanning" toggle appears, the license includes scanning. + +If your current DTR license doesn't include scanning, you must first download the new license. + +1. Log in to the Docker Store using a Docker ID with access to the license you need. +2. In the top right corner, click your user account icon, and select **Subscriptions**. +3. If necessary, select an organization account from the **Accounts** menu at the upper right. +4. Locate Docker Datacenter in the **Subscriptions** list. +5. Click **Subscription Details** and select **Setup instructions**. +6. Click **License key** below the Docker Datacenter logo. + The license key (a `.lic` file) is downloaded to your local computer. + ![](../../images/security-scanning-setup-1.png){: .with-border} +Next, install the new license on the DTR instance. + +7. Log in to your DTR instance using an administrator account. +8. Click **Settings** in the left navigation. +9. On the **General** tab click **Apply new license**. + + A file browser dialog appears. + +10. Navigate to where you saved the license key (`.lic`) file, select it, and click **Open**. + +![](../../images/security-scanning-setup-2.png){: .with-border} + +Proceed to [enable DTR Security Scanning](#enable-dtr-security-scanning). + +## Enable DTR security scanning + +To enable security scanning in DTR: + +1. Log in to your DTR instance with an administrator account. +2. Click **Settings** in the left navigation. +3. Click the **Security** tab. + + > **Note**: If you see a message on this tab telling you to contact your Docker sales representative, then the license installed on this DTR instance does not include Docker Security Scanning. Check that you have purchased Security Scanning, and that the DTR instance is using the latest license file. + +4. Click the **Enable scanning** toggle so that it turns blue and says "on". + ![](../../images/security-scanning-setup-3.png){: .with-border} +5. Next, provide a security database for the scanner. **Security scanning will not function until DTR has a security database to use.** + + By default, security scanning is enabled in **Online** mode. In this mode, + DTR attempts to download a security database from a Docker server. If your + installation cannot access `https://dss-cve-updates.docker.com/` you must + manually upload a `.tar` file containing the security database. + + - If you are using `Online` mode, the DTR instance will contact a Docker server, download the latest vulnerability database, and install it. Scanning can begin once this process completes. + - If you are using `Offline` mode, use the instructions in [Update scanning database - offline mode](#update-cve-database---offline-mode) to upload an initial security database. + +By default when Security Scanning is enabled, new repositories will automatically scan on `docker push`. If you had existing repositories before you enabled security scanning, you might want to [change repository scanning behavior](#set-repository-scanning-mode). + +## Set repository scanning mode + +Two modes are available when Security Scanning is enabled: + +- `Scan on push & Scan manually`: the image is re-scanned on each `docker push` to the repository, and whenever a user with `write` access clicks the **Start Scan** links or **Scan** button. +- `Scan manually`: the image is scanned only when a user with `write` access clicks the **Start Scan** links or **Scan** button. + +By default, _new_ repositories are set to `Scan on push & Scan manually`, but +you can change this setting during repository creation. + +![](../../images/security-scanning-setup-4.png){: .with-border} + +Any repositories that existed before scanning was enabled are set to `Scan manually` mode by default. If these repositories are still in use, you can change this setting from each repository's **Settings** page. + +> **Note**: To change an individual repository's scanning mode, you must have +`write` or `admin` access to the repo. + +To change an individual repository's scanning mode: + +1. Navigate to the repository, and click the **Settings** tab. +2. Scroll down to the **Image scanning** section. +3. Select the desired scanning mode. +![](../../images/security-scanning-setup-5.png){: .with-border} + +## Update the CVE scanning database + +Docker Security Scanning indexes the components in your DTR images and compares +them against a known CVE database. When new vulnerabilities are reported, Docker +Security Scanning matches the components in new CVE reports to the indexed +components in your images, and quickly generates an updated report. + +Users with administrator access to DTR can check when the CVE database was last updated from the **Security** tab in the DTR **Settings** pages. + +### Update CVE database - online mode + +By default Docker Security Scanning checks automatically for updates to the +vulnerability database, and downloads them when available. If your installation +does not have access to the public internet, use the [Offline mode instructions below](#update-cve-database-offline-mode). + +To ensure that DTR can access these updates, make sure that the host can reach +`https://dss-cve-updates.docker.com/` on port 443 using https. + +DTR checks for new CVE database updates at 3:00 AM UTC every day. If an update +is found it is downloaded and applied without interrupting any scans in +progress. Once the update is complete, the security scanning system looks for +new vulnerabilities in the indexed components. + +To set the update mode to Online: + +1. Log in to DTR as a user with administrator rights. +2. Click **Settings** in the left navigation and click **Security**. +3. Click **Online**. + +Your choice is saved automatically. + +> **Tip**: DTR also checks for CVE database updates when scanning is first enabled, and when you switch update modes. If you need to check for a CVE database update immediately, you can briefly switch modes from online to offline and back again. + +### Update CVE database - offline mode + +To update the CVE database for your DTR instance when it cannot contact the update server, you download and install a `.tar` file that contains the database updates. Contact us at [nautilus-feedback@docker.com](mailto:nautilus-feedback@docker.com?Subject=Need%20CVE%20database%20file) for an updated database file. + + + +To manually update the DTR CVE database from a `.tar` file: + +1. Log in to DTR as a user with administrator rights. +2. Click **Settings** in the left navigation and click **Security**. +4. Click **Upload .tar database file**. +5. Browse to the latest `.tar` file that you received, and click **Open**. + +DTR installs the new CVE database, and begins checking already indexed images +for components that match new or updated vulnerabilities. + +> **Tip**: The Upload button is unavailable while DTR applies CVE database updates. + +## Enable or disable automatic database updates + +To change the update mode: + +1. Log in to DTR as a user with administrator rights. +2. Click **Settings** in the left navigation and click **Security**. +3. Click **Online/Offline**. + +Your choice is saved automatically. + +## Where to go next + +* [Deploy a cache](deploy-a-cache.md) diff --git a/datacenter/dtr/2.2/guides/admin/configure/use-a-load-balancer.md b/datacenter/dtr/2.2/guides/admin/configure/use-a-load-balancer.md new file mode 100644 index 0000000000..28a368fcc8 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/configure/use-a-load-balancer.md @@ -0,0 +1,33 @@ +--- +title: Use a load balancer +description: Learn how to configure a load balancer to balance user requests across multiple Docker Trusted Registry replicas. +keywords: docker, dtr, load balancer +--- + +Once you’ve joined multiple DTR replicas nodes for high-availability, you can +configure your own load balancer to balance user requests across all replicas. + +![](../../images/use-a-load-balancer-1.svg) + + +This allows users to access DTR using a centralized domain name. If a replica +goes down, the load balancer can detect that and stop forwarding requests to +it, so that the failure goes unnoticed by users. + +## Load-balancing DTR + +DTR does not provide a load balancing service. You can use an on-premises +or cloud-based load balancer to balance requests across multiple DTR replicas. + +Make sure you configure your load balancer to: + +* Load-balance TCP traffic on ports 80 and 443 +* Not terminate HTTPS connections +* Use the `/health` endpoint on each DTR replica, to check if +the replica is healthy and if it should remain on the load balancing pool or +not + +## Where to go next + +* [Backups and disaster recovery](../backups-and-disaster-recovery.md) +* [DTR architecture](../../architecture.md) diff --git a/datacenter/dtr/2.2/guides/admin/configure/use-your-own-tls-certificates.md b/datacenter/dtr/2.2/guides/admin/configure/use-your-own-tls-certificates.md new file mode 100644 index 0000000000..364d91b538 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/configure/use-your-own-tls-certificates.md @@ -0,0 +1,45 @@ +--- +title: Use your own TLS certificates +description: Learn how to configure Docker Trusted Registry with your own TLS certificates. +keywords: docker, dtr, tls +--- + + +By default the DTR services are exposed using HTTPS, to ensure all +communications between clients and DTR is encrypted. Since DTR +replicas use self-signed certificates for this, when a client accesses +DTR, their browsers won't trust this certificate, so the browser displays a +warning message. + +You can configure DTR to use your own certificates, so that it is automatically +trusted by your users' browser and client tools. + +## Replace the server certificates + +To configure DTR to use your own certificates and keys, go to the +**DTR web UI**, navigate to the **Settings** page, and scroll down to the +**Domain** section. + +![](../../images/use-your-certificates-1.png) + + +Set the DTR domain name and upload the certificates and key: + +* Load balancer/public address, is the domain name clients will use to access DTR. +* TLS certificate, is the server certificate and any intermediate CA public +certificates. This certificate needs to be valid for the DTR public address, +and have SANs for all addresses used to reach the DTR replicas, including load +balancers. +* TLS private key is the server private key. +* TLS CA is the root CA public certificate. + +Finally, click **Save** for the changes to take effect. + +If you're using certificates issued by a globally trusted certificate authority, +any web browser or client tool should now trust DTR. If you're using an internal +certificate authority, you'll need to configure your system to trust that +certificate authority. + +## Where to go next + +* [Set up external storage](external-storage/index.md) diff --git a/datacenter/dtr/2.2/guides/admin/install/index.md b/datacenter/dtr/2.2/guides/admin/install/index.md new file mode 100644 index 0000000000..6f7d7ddcb1 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/install/index.md @@ -0,0 +1,129 @@ +--- +description: Learn how to install Docker Trusted Registry for production. +keywords: docker, dtr, registry, install +title: Install Docker Trusted Registry +--- + +Docker Trusted Registry (DTR) is a containerized application that runs on a +swarm managed by Docker Universal Control Plane (UCP). It can be installed +on-premises or on a cloud infrastructure. + +Use these instructions to install DTR. + +## Step 1. Validate the system requirements + +The first step in installing DTR, is ensuring your +infrastructure has all the [requirements DTR needs to run](system-requirements.md). + +## Step 2. Install UCP + +Since DTR requires Docker Universal Control Plane (UCP) +to run, you need to install UCP on all the nodes where you plan to install DTR. +[Learn how to install UCP](/datacenter/ucp/2.1/guides/admin/install.md). + +DTR needs to be installed on a worker node that is being managed by UCP. +You can't install DTR on a standalone Docker Engine. + +![](../../images/install-dtr-0.svg) + + +## Step 3. Install DTR + +To install DTR you use the `docker/dtr` image. This image has commands to +install, configure, and backup DTR. + +Run the following command to install DTR: + +```none +# Pull the latest version of DTR +$ docker pull {{ page.docker_image }} + +# Install DTR +$ docker run -it --rm \ + {{ page.docker_image }} install \ + --ucp-node \ + --ucp-insecure-tls +``` + +Where the `--ucp-node` is the hostname of the UCP node where you want to deploy +DTR. `--ucp-insecure-tls` tells the installer to trust the TLS certificates used +by UCP. + +The install command has other flags for customizing DTR at install time. +Check the [reference documentation to learn more](../../../reference/cli/install.md). + +## Step 4. Check that DTR is running + +In your browser, navigate to the Docker **Universal Control Plane** +web UI, and navigate to the **Applications** screen. DTR should be listed +as an application. + +![](../../images/install-dtr-1.png) + +You can also access the **DTR web UI**, to make sure it is working. In your +browser, navigate to the address where you installed DTR. + +![](../../images/install-dtr-2.png) + + +## Step 5. Configure DTR + +After installing DTR, you should configure: + + * The certificates used for TLS communication. [Learn more](../configure/use-your-own-tls-certificates.md). + * The storage backend to store the Docker images. [Lean more](../configure/external-storage/index.md). + + To perform these configurations, navigate to the **Settings** page of DTR. + + ![](../../images/install-dtr-3.png) + + +## Step 6. Test pushing and pulling + +Now that you have a working installation of DTR, you should test that you can +push and pull images to it. +[Learn how to push and pull images](../../user/manage-images/pull-and-push-images.md). + +## Step 7. Join replicas to the cluster + +This step is optional. + +To set up DTR for high availability, +you can add more replicas to your DTR cluster. Adding more replicas allows you +to load-balance requests across all replicas, and keep DTR working if a +replica fails. + +For high-availability you should set 3, 5, or 7 DTR replicas. The nodes where +you're going to install these replicas also need to be managed by UCP. + +To add replicas to a DTR cluster, use the `docker/dtr join` command: + +1. Load your UCP user bundle. + +2. Run the join command. + + When you join a replica to a DTR cluster, you need to specify the + ID of a replica that is already part of the cluster. You can find an + existing replica ID by going to the **Applications** page on UCP. + + Then run: + + ```none + docker run -it --rm \ + {{ page.docker_image }} join \ + --ucp-node \ + --ucp-insecure-tls + ``` + +3. Check that all replicas are running. + + In your browser, navigate to the Docker **Universal Control Plane** + web UI, and navigate to the **Applications** screen. All replicas should + be displayed. + + ![](../../images/install-dtr-4.png) + +## See also + +* [Install DTR offline](install-offline.md) +* [Upgrade DTR](../upgrade/index.md) diff --git a/datacenter/dtr/2.2/guides/admin/install/install-offline.md b/datacenter/dtr/2.2/guides/admin/install/install-offline.md new file mode 100644 index 0000000000..55ad6e97c5 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/install/install-offline.md @@ -0,0 +1,60 @@ +--- +description: Learn how to install Docker Trusted Registry on a machine with no internet + access. +keywords: docker, registry, install, offline +title: Install Docker Trusted Registry offline +--- + +The procedure to install Docker Trusted Registry on a host is the same, +whether that host has access to the internet or not. + +The only difference when installing on an offline host, +is that instead of pulling the UCP images from Docker Hub, you use a +computer that is connected to the internet to download a single package with +all the images. Then you copy that package to the host where you’ll install DTR. + +## Versions available + +{% include components/ddc_url_list.html %} + +## Download the offline package + +Use a computer with internet access to download a single package with all +Docker Datacenter components: + +```bash +$ wget -O docker-datacenter.tar.gz +``` + +Now that you have the package in your local machine, you can transfer it to +the machines where you want to install DTR. + +For each machine where you want to install DTR: + +1. Copy the Docker Datacenter package to that machine. + + ```bash + $ scp docker-datacenter.tar.gz @:/tmp + ``` + +2. Use ssh to login into the hosts where you transferred the package. + +3. Load the Docker Datacenter images. + + Once the package is transferred to the hosts, you can use the + `docker load` command, to load the Docker images from the tar archive: + + ```bash + $ docker load < docker-datacenter.tar.gz + ``` + +## Install DTR + +Now that the offline hosts have all the images needed to install DTR, +you can [install DTR on that host](index.md). + + +## Where to go next + +* [DTR architecture](../../architecture.md) +* [Install DTR](index.md) diff --git a/datacenter/dtr/2.2/guides/admin/install/system-requirements.md b/datacenter/dtr/2.2/guides/admin/install/system-requirements.md new file mode 100644 index 0000000000..bc1fbbe1d2 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/install/system-requirements.md @@ -0,0 +1,40 @@ +--- +description: Learn about the system requirements for installing Docker Trusted Registry. +keywords: docker, DTR, architecture, requirements +title: Docker Trusted Registry system requirements +--- + +Docker Trusted Registry can be installed on-premises or on the cloud. +Before installing, be sure your infrastructure has these requirements. + +## Software requirements + +You can only install DTR on a node that is being managed by Docker Universal +Control Plane. + +## Ports used + +When installing DTR on a node, make sure the following ports are open on that +node: + +| Direction | Port | Purpose | +|:---------:|:--------|:--------------------------------------| +| in | 80/tcp | Web app and API client access to DTR. | +| in | 443/tcp | Web app and API client access to DTR. | + +These ports are configurable when installing DTR. + +## Compatibility and maintenance lifecycle + +Docker Datacenter is a software subscription that includes 3 products: + +* CS Docker Engine, +* Docker Trusted Registry, +* Docker Universal Control Plane. + +[Learn more about the maintenance lifecycle for these products](http://success.docker.com/Get_Help/Compatibility_Matrix_and_Maintenance_Lifecycle). + +## Where to go next + +* [DTR architecture](../../architecture.md) +* [Install DTR](index.md) diff --git a/datacenter/dtr/2.2/guides/admin/install/uninstall.md b/datacenter/dtr/2.2/guides/admin/install/uninstall.md new file mode 100644 index 0000000000..2bee482939 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/install/uninstall.md @@ -0,0 +1,32 @@ +--- +description: Learn how to uninstall your Docker Trusted Registry installation. +keywords: docker, dtr, install, uninstall +title: Uninstall Docker Trusted Registry +--- + +Uninstalling DTR is a two-step process. You first scale your DTR deployment down +to a single replica. Then you uninstall the last DTR replica, which permanently +removes DTR and deletes all its data. + +Start by [scaling down your DTR deployment](../configure/set-up-high-availability.md) to a +single replica. + +When your DTR deployment is down to a single replica, you can use the +`docker/dtr destroy` command to permanently remove DTR and all its data: + +1. Use ssh to log into any node that is part of UCP. +2. Uninstall DTR: + +```none +docker run -it --rm \ + {{ page.docker_image }} destroy \ + --ucp-insecure-tls +``` + +To see what options are available in the destroy command, check the +[destroy command reference documentation](../../../reference/cli/destroy.md). + +## Where to go next + +* [Scale your deployment](../configure/set-up-high-availability.md) +* [Install DTR](index.md) diff --git a/datacenter/dtr/2.2/guides/admin/manage-users/create-and-manage-teams.md b/datacenter/dtr/2.2/guides/admin/manage-users/create-and-manage-teams.md new file mode 100644 index 0000000000..a097cecce1 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/manage-users/create-and-manage-teams.md @@ -0,0 +1,55 @@ +--- +description: Learn how to manage teams to enforce fine-grain access control in Docker + Trusted Registry. +keywords: docker, registry, security, permissions, teams +title: Create and manage teams in DTR +--- + +You can extend a user's default permissions by granting them individual +permissions in other image repositories, by adding the user to a team. A team +defines the permissions a set of users have for a set of repositories. + +To create a new team, go to the **DTR web UI**, and navigate to the +**Organizations** page. +Then **click the organization** where you want to create the team. In this +example, we'll create the 'billing' team under the 'whale' organization. + +![](../../images/create-and-manage-teams-1.png) + +Click '**+**' to create a new team, and give it a name. + +![](../../images/create-and-manage-teams-2.png) + +## Add users to a team + +Once you have created a team, **click the team** name, to manage its settings. +The first thing we need to do is add users to the team. Click the **Add user** +button and add users to the team. + +![](../../images/create-and-manage-teams-3.png) + +## Manage team permissions + +The next step is to define the permissions this team has for a set of +repositories. Navigate to the **Repositories** tab, and click the +**Add repository** button. + +![](../../images/create-and-manage-teams-4.png) + +Choose the repositories this team has access to, and what permission levels the +team members have. + +![](../../images/create-and-manage-teams-5.png) + +There are three permission levels available: + +| Permission level | Description | +|:-----------------|:-----------------------------------------------------------------| +| Read only | View repository and pull images. | +| Read & Write | View repository, pull and push images. | +| Admin | Manage repository and change its settings, pull and push images. | + +## Where to go next + +* [Create and manage users](create-and-manage-users.md) +* [Permission levels](permission-levels.md) diff --git a/datacenter/dtr/2.2/guides/admin/manage-users/create-and-manage-users.md b/datacenter/dtr/2.2/guides/admin/manage-users/create-and-manage-users.md new file mode 100644 index 0000000000..372bca5ba3 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/manage-users/create-and-manage-users.md @@ -0,0 +1,28 @@ +--- +description: Learn how to manage user permissions in Docker Trusted Registry. +keywords: docker, registry, security, permissions, users +title: Create and manage users in DTR +--- + +When using the Docker Datacenter built-in authentication, you can create users +to grant them fine-grained permissions. +Users are shared across Docker Datacenter. When you create a new user in +Docker Universal Control Plane, that user becomes available in DTR and vice +versa. + +To create a new user, go to the **DTR web UI**, and navigate to the **Users** +page. + +![](../../images/create-manage-users-1.png) + +Click the **New user** button, and fill-in the user information. + +![](../../images/create-manage-users-2.png) + +Check the **Trusted Registry admin** option, if you want to grant permissions +for the user to change Docker Datacenter configurations. + +## Where to go next + +* [Authentication and authorization](index.md) +* [Create and manage teams](create-and-manage-teams.md) diff --git a/datacenter/dtr/2.2/guides/admin/manage-users/index.md b/datacenter/dtr/2.2/guides/admin/manage-users/index.md new file mode 100644 index 0000000000..e8b916696a --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/manage-users/index.md @@ -0,0 +1,56 @@ +--- +description: Learn about the permission levels available on Docker Trusted Registry. +keywords: docker, registry, security, permissions, users +title: Authentication and authorization in DTR +--- + +With DTR you get to control which users have access to your image repositories. + +By default, anonymous users can only pull images from public repositories. +They can't create new repositories or push to existing ones. +You can then grant permissions to enforce fine-grained access control to image +repositories. For that: + +* Start by creating a user. + + Users are shared across Docker Datacenter. When you create a new user in + Docker Universal Control Plane, that user becomes available in DTR and vice + versa. Registered users can create and manage their own repositories. + + You can also integrate with an LDAP service to manage users from a single + place. + +* Extend the permissions by adding the user to a team. + + To extend a user's permission and manage their permissions over repositories, + you add the user to a team. + A team defines the permissions users have for a set of repositories. + + +## Organizations and teams + +When a user creates a repository, only that user can make changes to the +repository settings, and push new images to it. + +Organizations take permission management one step further, since they allow +multiple users to own and manage a common set of repositories. This +is useful when implementing team workflows. With organizations you can +delegate the management of a set of repositories and user permissions to the +organization administrators. + +An organization owns a set of repositories, and defines a set of teams. With +teams you can define fine-grain permissions that a team of +user has for a set of repositories. + +![](../../images/authentication-authorization-1.svg) + +In this example, the 'Whale' organization has three repositories and two teams: + +* Members of the blog team can only see and pull images from the whale/java +repository, +* Members of the billing team can manage the whale/golang repository, and push +and pull images from the whale/java repository. + +## Where to go next + +* [Create and manage users](create-and-manage-users.md) diff --git a/datacenter/dtr/2.2/guides/admin/manage-users/permission-levels.md b/datacenter/dtr/2.2/guides/admin/manage-users/permission-levels.md new file mode 100644 index 0000000000..e9b57d0fa0 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/manage-users/permission-levels.md @@ -0,0 +1,54 @@ +--- +description: Learn about the permission levels available in Docker Trusted Registry. +keywords: docker, registry, security, permissions +title: Permission levels in DTR +--- + +Docker Trusted Registry allows you to define fine-grain permissions over image +repositories. + +## Administrator users + +Users are shared across Docker Datacenter. When you create a new user in Docker +Universal Control Plane, that user becomes available in DTR and vice versa. +When you create an administrator user in DTR, that user is a Docker Datacenter +administrator, with permissions to: + +* Manage users across Docker Datacenter, +* Manage DTR repositories and settings, +* Manage the whole UCP cluster. + +## Team permission levels + +Teams allow you to define the permissions a set of user has for a set of +repositories. Three permission levels are available: + +| Repository operation | read | read-write | admin | +|:----------------------|:----:|:----------:|:-----:| +| View/ browse | x | x | x | +| Pull | x | x | x | +| Push | | x | x | +| Delete tags | | x | x | +| Edit description | | | x | +| Set public or private | | | x | +| Manage user access | | | x | +| Delete repository | | | | + +Team permissions are additive. When a user is a member of multiple teams, they +have the highest permission level defined by those teams. + +## Overall permissions + +Here's an overview of the permission levels available in DTR: + +* Anonymous users: Can search and pull public repositories. +* Users: Can search and pull public repos, and create and manage their own +repositories. +* Team member: Everything a user can do, plus the permissions granted by the teams the user is member of. +* Team admin: Everything a team member can do, and can also add members to the team. +* Organization admin: Everything a team admin can do, can create new teams, and add members to the organization. +* DDC admin: Can manage anything across UCP and DTR. + +## Where to go next + +* [Authentication and authorization](index.md) diff --git a/datacenter/dtr/2.2/guides/admin/monitor-and-troubleshoot/index.md b/datacenter/dtr/2.2/guides/admin/monitor-and-troubleshoot/index.md new file mode 100644 index 0000000000..6161bb2272 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/monitor-and-troubleshoot/index.md @@ -0,0 +1,42 @@ +--- +description: Learn how to monitor your DTR installation. +keywords: docker, registry, monitor, troubleshoot +title: Monitor Docker Trusted Registry +--- + +Docker Trusted Registry is a Dockerized application. To monitor it, you can +use the same tools and techniques you're already using to monitor other +containerized applications running on your cluster. One way to monitor +DTR is using the monitoring capabilities of Docker Universal Control Plane. + +In your browser, log in to **Docker Universal Control Plane** (UCP), and +navigate to the **Applications** page. + +To make it easier to find DTR, use the search box to **search for the +DTR application**. If you have DTR set up for high-availability, then all the +DTR nodes are displayed. + +![](../../images/monitor-1.png) + +**Click on the DTR application** to see all of its containers, and if they're +running. **Click on a container** to see its details, like configurations, +resources, and logs. + +![](../../images/monitor-2.png) + +## Health checks + +DTR also exposes several endpoints you can use to assess if a DTR replica +is healthy or not: + +* `/health`: Checks if the several components of a DTR replica are healthy, and +returns a simple json response. This is useful for load balancing or other +automated health check tasks. +* `/nginx_status`: Returns the number of connections being handled by the +NGINX front-end used by DTR. +* `/api/v0/meta/cluster_status`: Returns extensive information about all DTR +replicas. + +## Where to go next + +* [Troubleshoot with logs](troubleshoot-with-logs.md) diff --git a/datacenter/dtr/2.2/guides/admin/monitor-and-troubleshoot/troubleshoot-with-logs.md b/datacenter/dtr/2.2/guides/admin/monitor-and-troubleshoot/troubleshoot-with-logs.md new file mode 100644 index 0000000000..bf9a58fb8e --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/monitor-and-troubleshoot/troubleshoot-with-logs.md @@ -0,0 +1,64 @@ +--- +description: Learn how to troubleshoot your DTR installation. +keywords: docker, registry, monitor, troubleshoot +title: Troubleshoot Docker Trusted Registry +--- + + + +High availability in DTR depends on having overlay networking working in UCP. +To manually test that overlay networking is working in UCP run the following +commands on two different UCP machines. + +```none +docker run -it --rm --net dtr-ol --name overlay-test1 --entrypoint sh docker/dtr +docker run -it --rm --net dtr-ol --name overlay-test2 --entrypoint ping docker/dtr -c 3 overlay-test1 +``` + +You can create new overlay network for this test with `docker network create -d overaly network-name`. +You can also use any images that contain `sh` and `ping` for this test. + +If the second command succeeds, overlay networking is working. + +## DTR doesn't come up after a Docker restart + +This is a known issue with Docker restart policies when DTR is running on the same +machine as a UCP controller. If this happens, you can simply restart the DTR replica +from the UCP UI under "Applications". The best workaround right now is to not run +DTR on the same node as a UCP controller. + +## Etcd refuses to start after a Docker restart + +If you see the following log message in etcd's logs after a DTR restart it means that +your DTR replicas are on machines that don't have their clocks synchronized. Etcd requires +synchronized clocks to function correctly. + +``` +2016-04-27 17:56:34.086748 W | rafthttp: the clock difference against peer aa4fdaf4c562342d is too high [8.484795885s > 1s] +``` + +## Accessing the RethinkDB Admin UI + + > Warning: This command will expose your database to the internet with no authentication. Use with caution. + +Run this on the UCP node that has a DTR replica with the given replica id: + +``` +docker run --rm -it --net dtr-br -p 9999:8080 svendowideit/ambassador dtr-rethinkdb-$REPLICA_ID 8080 +``` + +Options to make this more secure: + +* Use `-p 127.0.0.1:9999:8080` to expose the admin UI only to localhost +* Use an SSH tunnel in combination with exposing the port only to localhost +* Use a firewall to limit which IPs are allowed to connect +* Use a second proxy with TLS and basic auth to provide secure access over the Internet + +## Accessing etcd directly + +You can execute etcd commands on a UCP node hosting a DTR replica using etcdctl +via the following docker command: + +``` +docker run --rm -v dtr-ca-$REPLICA_ID:/ca --net dtr-br -it --entrypoint /etcdctl docker/dtr-etcd:v2.2.4 --endpoint https://dtr-etcd-$REPLICA_ID.dtr-br:2379 --ca-file /ca/etcd/cert.pem --key-file /ca/etcd-client/key.pem --cert-file /ca/etcd-client/cert.pem +``` diff --git a/datacenter/dtr/2.2/guides/admin/upgrade/incompatibilities-and-breaking-changes.md b/datacenter/dtr/2.2/guides/admin/upgrade/incompatibilities-and-breaking-changes.md new file mode 100644 index 0000000000..fecf333cd7 --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/upgrade/incompatibilities-and-breaking-changes.md @@ -0,0 +1,9 @@ +--- +title: Incompatibilities and breaking changes +description: Learn about the incompatibilities and breaking changes introduced by Docker Trusted Registry version {{ page.dtr_version }} +keywords: docker, ucp, upgrade, incompatibilities +--- + +With Docker Trusted Registry {{ page.dtr_version }}, the `/load_balancer_status` +endpoint is deprecated and is going to be removed in future versions. Use the +`/health` endpoint instead. diff --git a/datacenter/dtr/2.2/guides/admin/upgrade/index.md b/datacenter/dtr/2.2/guides/admin/upgrade/index.md new file mode 100644 index 0000000000..5cb8ee20fd --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/upgrade/index.md @@ -0,0 +1,48 @@ +--- +description: Learn how to upgrade your Docker Trusted Registry +keywords: docker, dtr, upgrade, install +title: Upgrade DTR +--- + +The first step in upgrading to a new minor version or patch release of DTR 2.2, +is ensuring you're running DTR 2.1. If that's not the case, start by upgrading +your installation to version 2.1, and then upgrade to 2.2. + +There is no downtime when upgrading a highly-available DTR cluster. If your +DTR deployment has a single replica, schedule the upgrade to take place outside +business peak hours to ensure the impact on your business is close to none. + +## Step 1. Upgrade DTR to 2.1 + +Make sure you're running DTR 2.1. If that's not the case, [upgrade your installation to the 2.1 version](/datacenter/dtr/2.1/guides/install/upgrade/.md). + +## Step 2. Upgrade DTR + + + +To upgrade DTR, **login with ssh** into a node that's part of the UCP cluster. +Then pull the latest version of DTR: + +```none +$ docker pull {{ page.docker_image }} +``` + +If the node you're upgrading doesn't have access to the internet, you can +use a machine with internet connection to +[pull all the DTR images](../install/install-offline.md). + +Once you have the latest images on the node, run the upgrade command: + +```none +$ docker run -it --rm \ + {{ page.docker_image }} upgrade \ + --ucp-insecure-tls +``` + +By default the upgrade command runs in interactive mode and prompts you for +any necessary information. You can also check the +[reference documentation](../../../reference/cli/index.md) for other existing flags. + +## Where to go next + +* [Release notes](release-notes.md) diff --git a/datacenter/dtr/2.2/guides/admin/upgrade/release-notes.md b/datacenter/dtr/2.2/guides/admin/upgrade/release-notes.md new file mode 100644 index 0000000000..3e3cf9dfdb --- /dev/null +++ b/datacenter/dtr/2.2/guides/admin/upgrade/release-notes.md @@ -0,0 +1,78 @@ +--- +description: Docker Trusted Registry release notes +keywords: docker trusted registry, whats new, release notes +title: DTR 2.2 release notes +--- + +Here you can learn about new features, bug fixes, breaking changes and +known issues for each DTR version. + +You can then use [the upgrade instructions](index.md), +to upgrade your installation to the latest release. + +## DTR 2.2.1 + +(9 Feb 2017) + +**Bugs fixed** + +* Webhooks triggered on a security scan now have information about vulnerabilities +* The web UI now displays tag details and security scanning information for +images pushed before the upgrade +* When multiple tags shared the same manifest, the UI only displayed a single +tag. This has been fixed +* Fixed the UI not correctly showing the Dockerfile for tags in migrated +repositories + +## DTR 2.2.0 + +(9 Feb 2017) + +**New features** + +* DTR can now scan the binaries contained in the image layers, and report +security vulnerabilities +* You can now configure multiple caches, so that users can pull images faster +* You can now configure webhooks to run automated tasks that are triggered by +events like image push, repository creation, and others + +**General improvements** + +* UI/UX + * Improved error messages to be more meaningful and help troubleshoot the problem + * Several UI/UX improvements to the DTR configuration page and user settings page + * Several improvements to the search bar used in the UI + +* docker/dtr image + * The `docker/dtr install` command now shows all the nodes that are part of a + UCP cluster for you choose on which node to deploy DTR + * The install command was improved to avoid deploying DTR to a node where it + cannot run due to port collisions + * The `docker/dtr install --ucp-node` flag is now mandatory + * The install command no longer allows deploying replicas with duplica ids + * The upgrade command now validates if all tags were migrated to the latest + version before trying to migrate blob links + +**Bugs fixed** + +* When creating a repository, the length of the repository now is consistent +between the UI and API +* The UI now validate and doesn't allow creating repository names with uppercase +letters +* You can now create organizations with dashes in the name +* Fixed a bug that didn't allow deleting users immediately after they were +created +* The copy to clipboard button on the repository page now works on Firefox +* The repository page now renders properly the repository permissions +* You can now delete a users's full name from the UI +* Organization administrators can now see the repositories owned by the organization +* The garbage collection settings now show the correct cron values +* You can now specify DTR to use port 443 when installing DTR +* When you don't have permissions to see the repository details, the UI now +shows that you don't have permissions instead of saying it has no manifests +* Jobs are retried if the worker running them stops unexpectedly + +**Deprecation** + +The `/load_balancer_status` is deprecated and is going to be removed in future +versions. Use the `/health` endpoint instead. diff --git a/datacenter/dtr/2.2/guides/architecture.md b/datacenter/dtr/2.2/guides/architecture.md new file mode 100644 index 0000000000..3d266e038d --- /dev/null +++ b/datacenter/dtr/2.2/guides/architecture.md @@ -0,0 +1,102 @@ +--- +description: Learn about the architecture of Docker Trusted Registry. +keywords: docker, registry, dtr, architecture +title: DTR architecture +--- + +Docker Trusted Registry (DTR) is a containerized application that runs on a +Docker Universal Control Plane cluster. + +![](images/architecture-1.svg) + +Once you have DTR deployed, you use your Docker CLI client to login, push, and +pull images. + +## Under the hood + +For high-availability you can deploy multiple DTR replicas, one on each UCP +worker node. + +![](images/architecture-2.svg) + +All DTR replicas run the same set of services and changes to their configuration +are automatically propagated to other replicas. + +## DTR internal components + +When you install DTR on a node, the following containers are started: + +| Name | Description | +|:-------------------------------------|:-----------------------------------------------------------------------------------------------------------------------------------| +| dtr-api-<replica_id> | Executes the DTR business logic. It serves the DTR web application, and API | +| dtr-garant-<replica_id> | Manages DTR authentication | +| dtr-jobrunner-<replica_id> | Runs cleanup jobs in the background | +| dtr-nautilusstore-<replica_id> | Stores security scanning data | +| dtr-nginx-<replica_id> | Receives http and https requests and proxies them to other DTR components. By default it listens to ports 80 and 443 of the host | +| dtr-notary-server-<replica_id> | Receives, validates, and serves content trust metadata, and is consulted when pushing or pulling to DTR with content trust enabled | +| dtr-notary-signer-<replica_id> | Performs server-side timestamp and snapshot signing for content trust metadata | +| dtr-registry-<replica_id> | Implements the functionality for pulling and pushing Docker images. It also handles how images are stored | +| dtr-rethinkdb-<replica_id> | A database for persisting repository metadata | + +All these components are for internal use of DTR. Don't use them in your applications. + +## Networks used by DTR + +To allow containers to communicate, when installing DTR the following networks +are created: + +| Name | Type | Description | +|:-------|:--------|:---------------------------------------------------------------------------------------| +| dtr-ol | overlay | Allows DTR components running on different nodes to communicate, to replicate DTR data | + + +## Volumes used by DTR + +DTR uses these named volumes for persisting data: + +| Volume name | Description | +|:--------------------------------------|:---------------------------------------------------------------------------------| +| dtr-ca-<replica_id> | Root key material for the DTR root CA that issues certificates | +| dtr-notary-<replica_id> | Certificate and keys for the Notary components | +| dtr-nautilus-store-<replica_id> | Vulnerability scans data | +| dtr-registry-<replica_id> | Docker images data, if DTR is configured to store images on the local filesystem | +| dtr-rethink-<replica_id> | Repository metadata | +| dtr-nfs-registry-<replica_id> | Docker images data, if DTR is configured to store images on NFS | + +You can customize the volume driver used for these volumes, by creating the +volumes before installing DTR. During the installation, DTR checks which volumes +don't exist in the node, and creates them using the default volume driver. + +By default, the data for these volumes can be found at +`/var/lib/docker/volumes//_data`. + +## Image storage + +By default, Docker Trusted Registry stores images on the filesystem of the node +where it is running, but you should configure it to use a centralized storage +backend. + +![](images/architecture-3.svg) + +DTR supports these storage backends: + +* NFS +* Amazon S3 +* Cleversafe +* Google Cloud Storage +* OpenStack Swift +* Microsoft Azure + +## How to interact with DTR + +DTR has a web UI where you can manage settings and user permissions. + +![](images/architecture-4.svg) + +You can push and pull images using the standard Docker CLI client or other tools +that can interact with a Docker registry. + +## Where to go next + +* [System requirements](admin/install/system-requirements.md) +* [Install DTR](admin/install/index.md) diff --git a/datacenter/dtr/2.2/guides/images/Makefile b/datacenter/dtr/2.2/guides/images/Makefile new file mode 100644 index 0000000000..15b73ad543 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/Makefile @@ -0,0 +1,47 @@ + +SIZE="1280px" +HOST=dtr.domain.com +HOSTIP:=192.168.18.131 +HOSTURL=https://$(HOST) +IMAGE=svendowideit/screenshot +#IMAGE=screenshot +RUNOPTS=docker run --rm -v $(CURDIR):/srv --add-host $(HOST):$(HOSTIP) +RUN=$(RUNOPTS) $(IMAGE) + +all: + # Needs to be run with no authentication + $(RUN) $(HOSTURL)/admin/ admin-metrics.png $(SIZE) + $(RUN) $(HOSTURL)/admin/logs/ admin-logs.png $(SIZE) + $(RUN) $(HOSTURL)/admin/settings/auth/ admin-settings-authentication.png $(SIZE) + $(RUN) $(HOSTURL)/admin/settings/general admin-settings.png $(SIZE) + $(RUN) $(HOSTURL)/admin/settings/security admin-settings-security.png $(SIZE) + $(RUN) $(HOSTURL)/admin/settings/storage admin-settings-storage.png $(SIZE) + $(RUN) $(HOSTURL)/admin/settings/license admin-settings-license.png $(SIZE) + +manual: + # --env-file=passwords.env + $(RUNOPTS) --env-file=passwords.env \ + $(IMAGE) \ + $(HOSTURL)/admin/settings#auth admin-settings-authentication-basic.png $(SIZE) + + #admin-settings-authentication-ldap.png + + +# TODO: needs manual intervention atm +qs1: + # this requires the hostname to resolve. + echo "$HOST $HOSTIP" >> /etc/hosts + # and requires that host to be added to the docker daemon's insecure registry settings + # maybe use a dind daemon? + + docker pull jenkins + docker tag -f jenkins t400s.home.org.au/ci-infrastructure/jnkns-img + docker push t400s.home.org.au/ci-infrastructure/jnkns-img + sleep 1 + $(RUN) $(HOSTURL)/admin/ console-push.png $(SIZE) + sleep 10 +qs2: + docker rmi jenkins t400s.home.org.au/ci-infrastructure/jnkns-img + docker pull t400s.home.org.au/ci-infrastructure/jnkns-img + sleep 1 + $(RUN) $(HOSTURL)/admin/ console-pull.png $(SIZE) diff --git a/datacenter/dtr/2.2/guides/images/admin-logs.png b/datacenter/dtr/2.2/guides/images/admin-logs.png new file mode 100644 index 0000000000..de2920f3ba Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-logs.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-metrics.png b/datacenter/dtr/2.2/guides/images/admin-metrics.png new file mode 100644 index 0000000000..99a5d548ac Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-metrics.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-auth.png b/datacenter/dtr/2.2/guides/images/admin-settings-auth.png new file mode 100644 index 0000000000..d7dd0bef85 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-auth.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-authentication-basic.png b/datacenter/dtr/2.2/guides/images/admin-settings-authentication-basic.png new file mode 100644 index 0000000000..3d9cbbe463 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-authentication-basic.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-authentication-ldap.png b/datacenter/dtr/2.2/guides/images/admin-settings-authentication-ldap.png new file mode 100644 index 0000000000..22b2b13598 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-authentication-ldap.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-authentication.png b/datacenter/dtr/2.2/guides/images/admin-settings-authentication.png new file mode 100644 index 0000000000..6453784c17 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-authentication.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-license.png b/datacenter/dtr/2.2/guides/images/admin-settings-license.png new file mode 100644 index 0000000000..5ed5559032 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-license.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-license2.png b/datacenter/dtr/2.2/guides/images/admin-settings-license2.png new file mode 100644 index 0000000000..725ddd9281 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-license2.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-security.png b/datacenter/dtr/2.2/guides/images/admin-settings-security.png new file mode 100644 index 0000000000..67077fdf2d Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-security.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-storage-azure.png b/datacenter/dtr/2.2/guides/images/admin-settings-storage-azure.png new file mode 100644 index 0000000000..95c04cc303 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-storage-azure.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-storage-s3.png b/datacenter/dtr/2.2/guides/images/admin-settings-storage-s3.png new file mode 100644 index 0000000000..9e142fb309 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-storage-s3.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings-storage.png b/datacenter/dtr/2.2/guides/images/admin-settings-storage.png new file mode 100644 index 0000000000..f6256d4f77 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings-storage.png differ diff --git a/datacenter/dtr/2.2/guides/images/admin-settings.png b/datacenter/dtr/2.2/guides/images/admin-settings.png new file mode 100644 index 0000000000..665255fb13 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/admin-settings.png differ diff --git a/datacenter/dtr/2.2/guides/images/architecture-1.svg b/datacenter/dtr/2.2/guides/images/architecture-1.svg new file mode 100644 index 0000000000..8f63e29679 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/architecture-1.svg @@ -0,0 +1,75 @@ + + + + architecture-1 + Created with Sketch. + + + + + + + + + + cloud servers + + + + + + virtual servers + + + + + + physical servers + + + + + + + CS Docker Engine + + + + + + Universal Control Plane + + + + + + Docker Trusted Registry + + + + + + your applications + + + + + + + + + docker run + + + + + + + docker push + + + + + + + \ No newline at end of file diff --git a/datacenter/dtr/2.2/guides/images/architecture-2.svg b/datacenter/dtr/2.2/guides/images/architecture-2.svg new file mode 100644 index 0000000000..e8de51d858 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/architecture-2.svg @@ -0,0 +1,225 @@ + + + + architecture-2 + Created with Sketch. + + + + + UCP cluster + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + \ No newline at end of file diff --git a/datacenter/dtr/2.2/guides/images/architecture-3.svg b/datacenter/dtr/2.2/guides/images/architecture-3.svg new file mode 100644 index 0000000000..7656909ea1 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/architecture-3.svg @@ -0,0 +1,160 @@ + + + + architecture-3 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + DTR cluster + + + + + overlay network + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + + object + storage + + + + + + \ No newline at end of file diff --git a/datacenter/dtr/2.2/guides/images/architecture-4.svg b/datacenter/dtr/2.2/guides/images/architecture-4.svg new file mode 100644 index 0000000000..056ab55076 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/architecture-4.svg @@ -0,0 +1,356 @@ + + + + architecture-4 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Docker swarm + + + + + + + + + your load balancer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + your load balancer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + + + + UI + + + + + + CLI + + + + + + + + UI + + + + + + CLI + + + + + + + + \ No newline at end of file diff --git a/datacenter/dtr/2.2/guides/images/authentication-authorization-1.svg b/datacenter/dtr/2.2/guides/images/authentication-authorization-1.svg new file mode 100644 index 0000000000..72b3492d96 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/authentication-authorization-1.svg @@ -0,0 +1,90 @@ + + + + dtr-authorization-1 + Created with Sketch. + + + + + + + + + + + + + + + billing team + + + + + blog team + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + whale/node + + + + + + whale/java + + + + + + whale/golang + + + + + + + Whale organization + + + + + \ No newline at end of file diff --git a/datacenter/dtr/2.2/guides/images/aws-dtr-sg-rules.png b/datacenter/dtr/2.2/guides/images/aws-dtr-sg-rules.png new file mode 100644 index 0000000000..c8cf00297b Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/aws-dtr-sg-rules.png differ diff --git a/datacenter/dtr/2.2/guides/images/aws-engine-sg-rules.png b/datacenter/dtr/2.2/guides/images/aws-engine-sg-rules.png new file mode 100644 index 0000000000..0d6d6e821b Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/aws-engine-sg-rules.png differ diff --git a/datacenter/dtr/2.2/guides/images/aws-instance-id.png b/datacenter/dtr/2.2/guides/images/aws-instance-id.png new file mode 100644 index 0000000000..6337bf442a Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/aws-instance-id.png differ diff --git a/datacenter/dtr/2.2/guides/images/azure_filter.png b/datacenter/dtr/2.2/guides/images/azure_filter.png new file mode 100644 index 0000000000..bc89660185 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/azure_filter.png differ diff --git a/datacenter/dtr/2.2/guides/images/azure_ip.png b/datacenter/dtr/2.2/guides/images/azure_ip.png new file mode 100644 index 0000000000..d42e97bddd Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/azure_ip.png differ diff --git a/datacenter/dtr/2.2/guides/images/azure_portal.png b/datacenter/dtr/2.2/guides/images/azure_portal.png new file mode 100644 index 0000000000..b0507cbed6 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/azure_portal.png differ diff --git a/datacenter/dtr/2.2/guides/images/basic_configuration.png b/datacenter/dtr/2.2/guides/images/basic_configuration.png new file mode 100644 index 0000000000..c7845b0198 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/basic_configuration.png differ diff --git a/datacenter/dtr/2.2/guides/images/cache-docker-images-1.svg b/datacenter/dtr/2.2/guides/images/cache-docker-images-1.svg new file mode 100644 index 0000000000..338dcdcd53 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/cache-docker-images-1.svg @@ -0,0 +1,53 @@ + + + + content-cache-1 + Created with Sketch. + + + + + + + + + + + + + + + cache CH + + + + + + + + cache AS + + + + + + cache EU + + + + + + cache US + + + + + + + DTR + + + + + + \ No newline at end of file diff --git a/datacenter/dtr/2.2/guides/images/cache-docker-images-2.png b/datacenter/dtr/2.2/guides/images/cache-docker-images-2.png new file mode 100644 index 0000000000..dd60832b44 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/cache-docker-images-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/cache-docker-images-3.png b/datacenter/dtr/2.2/guides/images/cache-docker-images-3.png new file mode 100644 index 0000000000..085ac31f86 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/cache-docker-images-3.png differ diff --git a/datacenter/dtr/2.2/guides/images/cache-docker-images-4.png b/datacenter/dtr/2.2/guides/images/cache-docker-images-4.png new file mode 100644 index 0000000000..93f76f1a78 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/cache-docker-images-4.png differ diff --git a/datacenter/dtr/2.2/guides/images/console-pull.png b/datacenter/dtr/2.2/guides/images/console-pull.png new file mode 100644 index 0000000000..c2d1194bed Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/console-pull.png differ diff --git a/datacenter/dtr/2.2/guides/images/console-push.png b/datacenter/dtr/2.2/guides/images/console-push.png new file mode 100644 index 0000000000..79ddc7d5ef Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/console-push.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-and-manage-orgs-1.png b/datacenter/dtr/2.2/guides/images/create-and-manage-orgs-1.png new file mode 100644 index 0000000000..1b242c0148 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-and-manage-orgs-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-and-manage-orgs-2.png b/datacenter/dtr/2.2/guides/images/create-and-manage-orgs-2.png new file mode 100644 index 0000000000..6f010ea345 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-and-manage-orgs-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-and-manage-orgs-3.png b/datacenter/dtr/2.2/guides/images/create-and-manage-orgs-3.png new file mode 100644 index 0000000000..a0793bd592 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-and-manage-orgs-3.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-and-manage-teams-1.png b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-1.png new file mode 100644 index 0000000000..3c0c7ac437 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-and-manage-teams-2.png b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-2.png new file mode 100644 index 0000000000..48f69a9c88 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-and-manage-teams-3.png b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-3.png new file mode 100644 index 0000000000..07bcd825e5 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-3.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-and-manage-teams-4.png b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-4.png new file mode 100644 index 0000000000..823defa208 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-4.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-and-manage-teams-5.png b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-5.png new file mode 100644 index 0000000000..d70972364f Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-and-manage-teams-5.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-manage-users-1.png b/datacenter/dtr/2.2/guides/images/create-manage-users-1.png new file mode 100644 index 0000000000..cbf30037c9 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-manage-users-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-manage-users-2.png b/datacenter/dtr/2.2/guides/images/create-manage-users-2.png new file mode 100644 index 0000000000..91360649ab Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-manage-users-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-repository-1.png b/datacenter/dtr/2.2/guides/images/create-repository-1.png new file mode 100644 index 0000000000..ce53a90d17 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-repository-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/create-repository-2.png b/datacenter/dtr/2.2/guides/images/create-repository-2.png new file mode 100644 index 0000000000..6ec8ae7463 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/create-repository-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/dashboard-settings-general.png b/datacenter/dtr/2.2/guides/images/dashboard-settings-general.png new file mode 100644 index 0000000000..f30a948b0c Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/dashboard-settings-general.png differ diff --git a/datacenter/dtr/2.2/guides/images/delete-images-1.png b/datacenter/dtr/2.2/guides/images/delete-images-1.png new file mode 100644 index 0000000000..beff50eefc Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/delete-images-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/docker-hub-org-enterprise-license-CSDE-dropdown.png b/datacenter/dtr/2.2/guides/images/docker-hub-org-enterprise-license-CSDE-dropdown.png new file mode 100644 index 0000000000..fe7a6d2045 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/docker-hub-org-enterprise-license-CSDE-dropdown.png differ diff --git a/datacenter/dtr/2.2/guides/images/docker-hub-org-enterprise-license.png b/datacenter/dtr/2.2/guides/images/docker-hub-org-enterprise-license.png new file mode 100644 index 0000000000..2f2976f1a3 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/docker-hub-org-enterprise-license.png differ diff --git a/datacenter/dtr/2.2/guides/images/dtr-integration-1.png b/datacenter/dtr/2.2/guides/images/dtr-integration-1.png new file mode 100644 index 0000000000..a73ef063c1 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/dtr-integration-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/dtr-license-download.png b/datacenter/dtr/2.2/guides/images/dtr-license-download.png new file mode 100644 index 0000000000..f614e202a8 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/dtr-license-download.png differ diff --git a/datacenter/dtr/2.2/guides/images/install-dtr-0.svg b/datacenter/dtr/2.2/guides/images/install-dtr-0.svg new file mode 100644 index 0000000000..e8de51d858 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/install-dtr-0.svg @@ -0,0 +1,225 @@ + + + + architecture-2 + Created with Sketch. + + + + + UCP cluster + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + \ No newline at end of file diff --git a/datacenter/dtr/2.2/guides/images/install-dtr-1.png b/datacenter/dtr/2.2/guides/images/install-dtr-1.png new file mode 100644 index 0000000000..c17e7f0d5c Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/install-dtr-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/install-dtr-2.png b/datacenter/dtr/2.2/guides/images/install-dtr-2.png new file mode 100644 index 0000000000..2a284ed12f Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/install-dtr-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/install-dtr-3.png b/datacenter/dtr/2.2/guides/images/install-dtr-3.png new file mode 100644 index 0000000000..37dea664cb Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/install-dtr-3.png differ diff --git a/datacenter/dtr/2.2/guides/images/install-dtr-4.png b/datacenter/dtr/2.2/guides/images/install-dtr-4.png new file mode 100644 index 0000000000..87508be693 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/install-dtr-4.png differ diff --git a/datacenter/dtr/2.2/guides/images/jenkins-plugins.png b/datacenter/dtr/2.2/guides/images/jenkins-plugins.png new file mode 100644 index 0000000000..82cd8a00f9 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/jenkins-plugins.png differ diff --git a/datacenter/dtr/2.2/guides/images/jenkins-ui.png b/datacenter/dtr/2.2/guides/images/jenkins-ui.png new file mode 100644 index 0000000000..e828dfbab8 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/jenkins-ui.png differ diff --git a/datacenter/dtr/2.2/guides/images/license-1.png b/datacenter/dtr/2.2/guides/images/license-1.png new file mode 100644 index 0000000000..58539aa40d Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/license-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/license-2.png b/datacenter/dtr/2.2/guides/images/license-2.png new file mode 100644 index 0000000000..37dea664cb Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/license-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/monitor-1.png b/datacenter/dtr/2.2/guides/images/monitor-1.png new file mode 100644 index 0000000000..87508be693 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/monitor-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/monitor-2.png b/datacenter/dtr/2.2/guides/images/monitor-2.png new file mode 100644 index 0000000000..c17e7f0d5c Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/monitor-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/overview-1.png b/datacenter/dtr/2.2/guides/images/overview-1.png new file mode 100644 index 0000000000..36153b8a07 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/overview-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/overview-2.png b/datacenter/dtr/2.2/guides/images/overview-2.png new file mode 100644 index 0000000000..9bb034c54d Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/overview-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/pull-push-images-1.png b/datacenter/dtr/2.2/guides/images/pull-push-images-1.png new file mode 100644 index 0000000000..b95124da2b Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/pull-push-images-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/pull-push-images-2.png b/datacenter/dtr/2.2/guides/images/pull-push-images-2.png new file mode 100644 index 0000000000..d9e91bc86b Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/pull-push-images-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/pull-push-images-3.png b/datacenter/dtr/2.2/guides/images/pull-push-images-3.png new file mode 100644 index 0000000000..65e6e8b14d Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/pull-push-images-3.png differ diff --git a/datacenter/dtr/2.2/guides/images/repo.png b/datacenter/dtr/2.2/guides/images/repo.png new file mode 100644 index 0000000000..9b08a6bbfc Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/repo.png differ diff --git a/datacenter/dtr/2.2/guides/images/scanning_video.png b/datacenter/dtr/2.2/guides/images/scanning_video.png new file mode 100644 index 0000000000..efa6737639 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/scanning_video.png differ diff --git a/datacenter/dtr/2.2/guides/images/script-copy.png b/datacenter/dtr/2.2/guides/images/script-copy.png new file mode 100644 index 0000000000..3fdf87c7b8 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/script-copy.png differ diff --git a/datacenter/dtr/2.2/guides/images/security-scanning-setup-1.png b/datacenter/dtr/2.2/guides/images/security-scanning-setup-1.png new file mode 100644 index 0000000000..794f8f9e80 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/security-scanning-setup-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/security-scanning-setup-2.png b/datacenter/dtr/2.2/guides/images/security-scanning-setup-2.png new file mode 100644 index 0000000000..a0da4ab754 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/security-scanning-setup-2.png differ diff --git a/datacenter/dtr/2.2/guides/images/security-scanning-setup-3.png b/datacenter/dtr/2.2/guides/images/security-scanning-setup-3.png new file mode 100644 index 0000000000..7dee18592e Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/security-scanning-setup-3.png differ diff --git a/datacenter/dtr/2.2/guides/images/security-scanning-setup-4.png b/datacenter/dtr/2.2/guides/images/security-scanning-setup-4.png new file mode 100644 index 0000000000..b616bd090a Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/security-scanning-setup-4.png differ diff --git a/datacenter/dtr/2.2/guides/images/security-scanning-setup-5.png b/datacenter/dtr/2.2/guides/images/security-scanning-setup-5.png new file mode 100644 index 0000000000..d6fd310a2a Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/security-scanning-setup-5.png differ diff --git a/datacenter/dtr/2.2/guides/images/set-up-high-availability-1.svg b/datacenter/dtr/2.2/guides/images/set-up-high-availability-1.svg new file mode 100644 index 0000000000..b86fc8f357 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/set-up-high-availability-1.svg @@ -0,0 +1,310 @@ + + + + set-up-high-availability-1 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Docker swarm + + + + + + + + + your load balancer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + your load balancer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + + + + + + + + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + + + + UI + + + + + + CLI + + + + + + + + UI + + + + + + CLI + + + + + + + + \ No newline at end of file diff --git a/datacenter/dtr/2.2/guides/images/use-a-cache-1.png b/datacenter/dtr/2.2/guides/images/use-a-cache-1.png new file mode 100644 index 0000000000..93f76f1a78 Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/use-a-cache-1.png differ diff --git a/datacenter/dtr/2.2/guides/images/use-a-load-balancer-1.svg b/datacenter/dtr/2.2/guides/images/use-a-load-balancer-1.svg new file mode 100644 index 0000000000..b86fc8f357 --- /dev/null +++ b/datacenter/dtr/2.2/guides/images/use-a-load-balancer-1.svg @@ -0,0 +1,310 @@ + + + + set-up-high-availability-1 + Created with Sketch. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Docker swarm + + + + + + + + + your load balancer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + your load balancer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + + + + + + + worker node + + + + + + + CS Docker Engine + + + + + + UCP worker + + + + + + DTR + + + + + + + + + + + + + + + + + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + manager node + + + + + + + CS Docker Engine + + + + + + UCP manager + + + + + + + + + + + + + UI + + + + + + CLI + + + + + + + + UI + + + + + + CLI + + + + + + + + \ No newline at end of file diff --git a/datacenter/dtr/2.2/guides/images/use-your-certificates-1.png b/datacenter/dtr/2.2/guides/images/use-your-certificates-1.png new file mode 100644 index 0000000000..c23e89e2aa Binary files /dev/null and b/datacenter/dtr/2.2/guides/images/use-your-certificates-1.png differ diff --git a/datacenter/dtr/2.2/guides/index.md b/datacenter/dtr/2.2/guides/index.md new file mode 100644 index 0000000000..faba203454 --- /dev/null +++ b/datacenter/dtr/2.2/guides/index.md @@ -0,0 +1,42 @@ +--- +description: Learn how to install, configure, and use Docker Trusted Registry. +keywords: docker, registry, repository, images +title: Docker Trusted Registry 2.2 overview +redirect_from: +- /docker-hub-enterprise/ +- /docker-trusted-registry/overview/ +- /docker-trusted-registry/ +--- + +Docker Trusted Registry (DTR) is the enterprise-grade image storage solution +from Docker. You install it behind your firewall so that you can securely store +and manage the Docker images you use in your applications. + +## Image management + +Docker Trusted Registry can be installed on-premises, or on a virtual private +cloud. And with it, you can store your Docker images securely, behind your +firewall. + +![](images/overview-1.png) + +You can use DTR as part of your continuous integration, and continuous +delivery processes to build, run, and ship your applications. + + +## Built-in security and access control + +DTR uses the same authentication mechanism as Docker Universal Control Plane. +It has a built-in authentication mechanism, and also integrates with LDAP +and Active Directory. It also supports Role Based Access Control (RBAC). + +This allows you to implement fine-grain access control policies on who has +access to your Docker images. + +![](images/overview-2.png) + + +## Where to go next + +* [DTR architecture](architecture.md) +* [Install DTR](admin/install/index.md) diff --git a/datacenter/dtr/2.2/guides/support.md b/datacenter/dtr/2.2/guides/support.md new file mode 100644 index 0000000000..660252beb0 --- /dev/null +++ b/datacenter/dtr/2.2/guides/support.md @@ -0,0 +1,18 @@ +--- +description: Your Docker subscription gives you access to prioritized support. You + can file tickets via email, your the support portal. +keywords: Docker, support, help +title: Get support for DTR +--- + + + +Your Docker Data Center, or Docker Trusted Registry subscription gives you +access to prioritized support. The service levels depend on your subscription. + +If you need help, you can file a ticket via: + +* [Email](mailto:support@docker.com) +* [Docker support page](https://support.docker.com/) + +Be sure to use your company email when filing tickets. diff --git a/datacenter/dtr/2.2/guides/user/access-dtr/index.md b/datacenter/dtr/2.2/guides/user/access-dtr/index.md new file mode 100644 index 0000000000..1b11f1bab1 --- /dev/null +++ b/datacenter/dtr/2.2/guides/user/access-dtr/index.md @@ -0,0 +1,109 @@ +--- +title: Configure your Docker Engine +description: Learn how to configure your Docker Engine to push and pull images from Docker Trusted Registry. +keywords: docker, registry, TLS, certificates +--- + +By default Docker Engine uses TLS when pushing and pulling images to an +image registry like Docker Trusted Registry. + +If DTR is using the default configurations or was configured to use self-signed +certificates, you need to configure your Docker Engine to trust DTR. Otherwise, +when you try to log in, push to, or pull images from DTR, you'll get an error: + +```none +$ docker login dtr.example.org + +x509: certificate signed by unknown authority +``` + +The first step to make your Docker Engine trust the certificate authority used +by DTR is to get the DTR CA certificate. Then you configure your operating +system to trust that certificate. + +## Configure your host + +### macOS + +In your browser navigate to `https:///ca` to download the TLS +certificate used by DTR. Then +[add that certificate to the macOS trust store](https://support.apple.com/kb/PH18677?locale=en_US). + +### Windows + +In your browser navigate to `https:///ca` to download the TLS +certificate used by DTR. Then +[add that certificate to the Windows trust store](https://technet.microsoft.com/en-us/library/cc754841(v=ws.11).aspx). + + +### Ubuntu/ Debian + +```bash +# Download the DTR CA certificate +$ curl -k https:///ca -o /usr/local/share/ca-certificates/.crt +# Refresh the list of certificates to trust +$ sudo update-ca-certificates +# Restart the Docker daemon +$ sudo service docker restart +``` + +### RHEL/ CentOS + +```bash +# Download the DTR CA certificate +$ curl -k https:///ca -o /etc/pki/ca-trust/source/anchors/.crt +# Refresh the list of certificates to trust +$ sudo update-ca-trust +# Restart the Docker daemon +$ sudo /bin/systemctl restart docker.service +``` + +### Boot2Docker + +1. Login into the virtual machine with ssh: + + ```bash + docker-machine ssh + ``` + +2. Create the `bootsync.sh` file, and make it executable: + + ```bash + sudo touch /var/lib/boot2docker/bootsync.sh + sudo chmod 755 /var/lib/boot2docker/bootsync.sh + ``` + +3. Add the following content to the `bootsync.sh` file. You can use nano or vi + for this. + + ```bash + #!/bin/sh + + cat /var/lib/boot2docker/server.pem >> /etc/ssl/certs/ca-certificates.crt + ``` + +4. Add the DTR CA certificate to the `server.pem` file: + + ```bash + curl -k https:///ca | sudo tee -a /var/lib/boot2docker/server.pem + ``` + +5. Run `bootsync.sh` and restart the Docker daemon: + + ```bash + sudo /var/lib/boot2docker/bootsync.sh + sudo /etc/init.d/docker restart + ``` + +## Login into DTR + +To validate that your Docker daemon trusts DTR, trying authenticating against +DTR. + +```bash +docker login dtr.example.org +``` + +## Where to go next + +* [Use a cache](use-a-cache.md) diff --git a/datacenter/dtr/2.2/guides/user/access-dtr/use-a-cache.md b/datacenter/dtr/2.2/guides/user/access-dtr/use-a-cache.md new file mode 100644 index 0000000000..b68bacaeb7 --- /dev/null +++ b/datacenter/dtr/2.2/guides/user/access-dtr/use-a-cache.md @@ -0,0 +1,17 @@ +--- +title: Use a cache +description: Learn how to configure your Docker Trusted Registry account to pull images from a cache for faster download times. +keywords: docker, registry, cache +--- + +Docker Trusted Registry can be configured to have one or more caches. This +allows you to choose from which cache to pull images from for faster +download times. + +If an administrator has set up caches, you can choose which cache to use when +pulling images. In the **DTR web UI**, navigate to your **user profile**, +and check the **Content Cache** options. + +![](../../images/use-a-cache-1.png){: .with-border} + +Once you save, your images are pulled from the cache instead of the central DTR. diff --git a/datacenter/dtr/2.2/guides/user/create-and-manage-webhooks.md b/datacenter/dtr/2.2/guides/user/create-and-manage-webhooks.md new file mode 100644 index 0000000000..da9cab69eb --- /dev/null +++ b/datacenter/dtr/2.2/guides/user/create-and-manage-webhooks.md @@ -0,0 +1,313 @@ +--- +title: Manage webhooks +description: Learn how to create, configure, and test webhooks in Docker Trusted Registry. +keywords: docker, registry, webhooks +--- + +DTR includes webhooks for common events, such as pushing a new tag or deleting +an image. This lets you build complex CI and CD pipelines from your own DTR +cluster. + +The webhook events you can subscribe to are: + +**Repository specific events** + +- Tag push +- Tag delete +- Manifest push +- Manifest delete +- Security scan completed +- Security scan failed + +**Namespace specific events** + +- Repo events (created/updated/deleted) + +**Global events** + +- Security scanner update complete + +In order to subscribe to an event you need to be at least an admin of the +particular repository (for repository events) or namespace +(for namespace events). A global administrator can subscribe to any event. +For example, a user must be an admin of repository "foo/bar" to subscribe to +its tag push events. + +## Subscribing to events + +In order to subscribe to events you must send an API query to +`/api/v0/webhooks` with the following payload: + +``` +{ + "type": "", + "key": "", + "endpoint": "https://example.com" +} +``` + +The keys in the payload are: + +- `type`: The event type. These are listed below. +- `key`: The namespace or repo to subscribe to (eg "foo/bar" to subscribe to +pushes to repo "bar" within namespace "foo") +- `endpoint`: The URL to send the POST payload to. + +Normal users **must** supply a "key" to scope a particular webhook event to +a repository or namespace. System administrators can choose to omit this, +meaning a webhook payload will be sent for **every** repository or namespace. + +### Event types + +**Repository specific events** + +- Tag push (type `TAG_PUSH`) +- Tag delete (type `TAG_DELETE`) +- Manifest push (type `MANIFEST_PUSH`) +- Manifest delete (type `MANIFEST_DELETE`) +- Security scan completed (type `SCAN_COMPLETED`) +- Security scan failed (type `SCAN_FAILED`) + +**Namespace specific events** + +- Repo created/updated/deleted (type `REPO_EVENT`) + +**Global events** + +- Security scanner update complete (type `SCANNER_UPDATE_COMPLETED`) + + +### Receiving a payload + +Whenever a suitable action occurs DTR will send a POST request to the given +endpoint with a JSON encoded payload. The payload will always have the +following wrapper: + +``` +{ + "type": "...", + "createdAt": "2012-04-23T18:25:43.511Z", + "contents": {...} +} +``` + +`type` refers to the event type being sent, and `contents` refers to +the payload of the event itself. Each event is different, therefore the +structure of the JSON object in `contents` will change depending on the event +type. These are listed in a section below. + +### Testing payload subscriptions + +Before subscribing to a payload you can view and test your endpoints using +fake data. To send a test payload, fire a `POST` request to +`/api/v0/webhooks/test` with the following payload: + +``` +{ + "type": "...", + "endpoint": "https://www.example.com/" +} +``` + +Change `type` to the event type that you want to receive. DTR will then send +an example payload to the endpoint specified. Note that the example +payload sent is always the same. + +## Content structure + +Note that comments (`// here`) are added for documentation only; they are not +present in POST payloads. + +### Repository event content structure + +**Tag push** + +``` +{ + "namespace": "", // (string) repository's namespace name + "repository": "", // (string) repository name + "tag": "", // (string) the name of the tag just pushed + "digest": "", // (string) sha256 digest of the manifest the tag points to (eg. "sha256:0afb...") + "imageName": "", // (string) the fully-qualified image name including DTR host used to pull the image (eg. 10.10.10.1/foo/bar:tag) + "os": "", // (string) the OS for the tag's manifest + "architecture": "", // (string) the architecture for the tag's manifest + "author": "", // (string) the username of the person who pushed the tag + "pushedAt": "", // (string) JSON encoded timestamp of when the push occurred +} +``` + +**Tag delete** + +``` +{ + "namespace": "", // (string) repository's namespace name + "repository": "", // (string) repository name + "tag": "", // (string) the name of the tag just deleted + "digest": "", // (string) sha256 digest of the manifest the tag points to (eg. "sha256:0afb...") + "imageName": "", // (string) the fully-qualified image name including DTR host used to pull the image (eg. 10.10.10.1/foo/bar:tag) + "os": "", // (string) the OS for the tag's manifest + "architecture": "", // (string) the architecture for the tag's manifest + "author": "", // (string) the username of the person who deleted the tag + "deletedAt": "", // (string) JSON encoded timestamp of when the delete occurred +} +``` +**Manifest push** + +``` +{ + "namespace": "", // (string) repository's namespace name + "repository": "", // (string) repository name + "digest": "", // (string) sha256 digest of the manifest (eg. "sha256:0afb...") + "imageName": "", // (string) the fully-qualified image name including DTR host used to pull the image (eg. 10.10.10.1/foo/bar@sha256:0afb...) + "os": "", // (string) the OS for the manifest + "architecture": "", // (string) the architecture for the manifest + "author": "", // (string) the username of the person who pushed the manifest + "pushedAt": "", // (string) JSON encoded timestamp of when the push occurred +} +``` + +**Manifest delete** + +``` +{ + "namespace": "", // (string) repository's namespace name + "repository": "", // (string) repository name + "digest": "", // (string) sha256 digest of the manifest (eg. "sha256:0afb...") + "imageName": "", // (string) the fully-qualified image name including DTR host used to pull the image (eg. 10.10.10.1/foo/bar@sha256:0afb...) + "os": "", // (string) the OS for the manifest + "architecture": "", // (string) the architecture for the manifest + "author": "", // (string) the username of the person who deleted the manifest + "deletedAt": "", // (string) JSON encoded timestamp of when the delete occurred +} +``` + +**Security scan completed** + +``` +{ + "namespace": "", // (string) repository's namespace name + "repository": "", // (string) repository name + "tag": "", // (string) the name of the tag scanned + "imageName": "", // (string) the fully-qualified image name including DTR host used to pull the image (eg. 10.10.10.1/foo/bar:tag) + "scanSummary": { + "namespace": "", // (string) repository's namespace name + "repository": "", // (string) repository name + "tag": "", // (string) the name of the tag just pushed + "critical": 0, // (int) number of critical issues, where CVSS >= 7.0 + "major": 0, // (int) number of major issues, where CVSS >= 4.0 && CVSS < 7 + "minor": 0, // (int) number of minor issues, where CVSS > 0 && CVSS < + "last_scan_status": 0, // (int) enum; see scan status section + "check_completed_at": "", // (string) JSON encoded timestamp of when the scan completed + } +} +``` + +**Security scan failed** + +``` +{ + "namespace": "", // (string) repository's namespace name + "repository": "", // (string) repository name + "tag": "", // (string) the name of the tag scanned + "imageName": "", // (string) the fully-qualified image name including DTR host used to pull the image (eg. 10.10.10.1/foo/bar@sha256:0afb...) + "error": "", // (string) the error that occurred whilst scanning +} +``` + +### Namespace specific event structure + +**Repository event (created/updated/deleted)** + +``` +{ + "namespace": "", // (string) repository's namespace name + "repository": "", // (string) repository name + "event": "", // (string) enum: "REPO_CREATED", "REPO_DELETED" or "REPO_UPDATED" + "author": "", // (string) the name of the user which authored the event + "data": {} // (object) when updating or creating a repo this follows the same format as an API response from /api/v0/repositories/{namespace}/{repository} +} +``` + +### Global event structure + +**Security scanner update complete** + +``` +{ + "scanner_version": "", + "scanner_updated_at": "", // (string) JSON encoded timestamp of when the scanner updated + "db_version": 0, // (int) newly updated database version + "db_updated_at": "", // (string) JSON encoded timestamp of when the database updated + "success": // (bool) whether the update was successful + "replicas": { // (object) a map keyed by replica ID containing update information for each replica + "replica_id": { + "db_updated_at": "", // (string) JSON encoded time of when the replica updated + "version": "", // (string) version updated to + "replica_id": "" // (string) replica ID + }, + ... + } +} +``` + +### Security scan status enums + + +- 0: Failed. An error occurred checking an image's layer +- 1: Unscanned. The image has not yet been scanned +- 2: Scanning: Scanning in progress +- 3: Pending: The image will be scanned when a worker is available +- 4: Scanned: The image has been scanned but vulnerabilities have not yet been checked +- 5: Checking: The image is being checked for vulnerabilities +- 6: Completed: The image has been fully security scanned + + +## Viewing and managing existing subscriptions + +### Viewing all subscriptions + +To view existing subscriptions make a GET request to `/api/v0/webhooks`. As +a normal user (ie. not a system administrator), this will show all of your +current subscriptions across every namespace and repository. As a system +administrator this will show **every** webhook within DTR. + +The API response will be in the following format: + +``` +[ + { + "id": "", // (string): UUID of the webhook subscription + "type": "", // (string): webhook event type + "key": "", // (string): the individual resource this subscription is scoped to + "endpoint": "", // (string): the endpoint in which the payload will be sent to via a POST request + "authorID": "", // (string): the ID of the user which created this subscription + "createdAt": "", // (string): JSON encoded datetime when this subscription was created + }, + ... +] +``` + +For more information view the API documentation. + +### Viewing subscriptions for a particular resource + +You can also view subscriptions for a given resource that you are an +administrator of. For example, if you have admin rights to the repository +"foo/bar" you can view all subscriptions (even other people's) from a +particular API endpoint. These endpoints are: + +- `/api/v0/repositories/{namespace}/{repository}/webhooks`: GET to view all +webhooks for a repository resource's events +- `/api/v0/repositories/{namespace}/webhooks`: GET to view all webhooks for a +namespace resource's events + +### Deleting a subscription + +To delete a webhook subscription send a `DELETE` request to +`/api/v0/webhooks/{id}`, replacing `{id}` with the webhook subscription ID +which you would like to delete. + +Note that in order to delete a subscription you must be either a system +administrator or an admistrator for the resource which the payload subscribes +to. For example, as a normal user you can only delete subscriptions for +repositories which you are an admin of. diff --git a/datacenter/dtr/2.2/guides/user/manage-images/delete-images.md b/datacenter/dtr/2.2/guides/user/manage-images/delete-images.md new file mode 100644 index 0000000000..6724c22af0 --- /dev/null +++ b/datacenter/dtr/2.2/guides/user/manage-images/delete-images.md @@ -0,0 +1,15 @@ +--- +title: Delete images +description: Learn how to delete images from Docker Trusted Registry. +keywords: docker, registry, delete +--- + +To delete an image, go to the **DTR web UI**, and navigate to the image +**repository** you want to delete. In the **Tags** tab, select all the image +tags you want to delete, and click the **Delete button**. + +![](../../images/delete-images-1.png) + +You can also delete all image versions, by deleting the repository. For that, +in the image **repository**, navigate to the **Settings** tab, and click the +**Delete** button. diff --git a/datacenter/dtr/2.2/guides/user/manage-images/index.md b/datacenter/dtr/2.2/guides/user/manage-images/index.md new file mode 100644 index 0000000000..77952a17db --- /dev/null +++ b/datacenter/dtr/2.2/guides/user/manage-images/index.md @@ -0,0 +1,37 @@ +--- +title: Create a repository +description: Learn how to create new repositories in Docker Trusted Registry. +keywords: docker, registry, repository +--- + +Since DTR is secure by default, you need to create the image repository before +being able to push the image to DTR. + +In this example, we'll create the 'golang' repository in DTR. + +## Create a repository + +To create a new repository, navigate to the **DTR web application**, and click +the **New repository** button. + +![](../../images/create-repository-1.png) + +Add a **name and description** for the repository, and choose whether your +repository is public or private: + + * Public repositories are visible to all users, but can only be changed by + users granted with permission to write them. + * Private repositories can only be seen by users that have been granted + permissions to that repository. + +![](../../images/create-repository-2.png) + +Click **Save** to create the repository. + +When creating a repository in DTR, the full name of the repository becomes +`//`. In this example, the full +name of our repository will be `dtr.company.org/dave.lauper/golang`. + +## Where to go next + +* [Pull and push images](pull-and-push-images.md) diff --git a/datacenter/dtr/2.2/guides/user/manage-images/manage-trusted-repositories.md b/datacenter/dtr/2.2/guides/user/manage-images/manage-trusted-repositories.md new file mode 100644 index 0000000000..d5326dfc67 --- /dev/null +++ b/datacenter/dtr/2.2/guides/user/manage-images/manage-trusted-repositories.md @@ -0,0 +1,126 @@ +--- +description: Learn how to use the Notary CLI client to manage trusted repositories +keywords: dtr, trust, notary, registry, security +title: Manage trusted repositories +--- + +Once you install the Notary CLI client, you can use it to manage your signing +keys, authorize other team members to sign images, and rotate the keys if +a private key has been compromised. + +When using the Notary CLI client you need to specify where is Notary server +you want to communicate with, and where to store the private keys and cache for +the CLI client. + +```bash +# Create an alias to always have the notary client talking to the right server +$ alias notary="notary -s https:// -d ~/.docker/trust" +``` + +## Manage staged changes + +The Notary CLI client stages changes before publishing them to the server. +You can manage the changes that are staged by running: + +```bash +# Check what changes are staged +$ notary status // + +# Unstage a specific change +$ notary status // --unstage 0 + +# Alternatively, unstage all changes +$ notary status // --reset +``` + +When you're ready to publish your chages to the Notary server, run: + +```bash +$ notary publish // +``` + +## Delete trust data + +Administrator users can remove all signatures from a trusted repository by +running: + +```bash +$ notary delete // --remote +``` + +If you don't include the `--remote` flag, Notary deletes local cached content +but will not delete data from the Notary server. + + +## Change the passphrase for a key + +The Notary CLI client manages the keys used to sign the image metadata. To +list all the keys managed by the Notary CLI client, run: + +```bash +$ notary key list +``` + +To chance the passphrase used to encrypt one of the keys, run: + +```bash +$ notary key passwd +``` + +## Rotate keys + +If one of the private keys is compromised you can rotate that key, so that +images that were signed with those keys stop being trusted. + +For keys that are kept offline and managed by the Notary CLI client, such the +keys with the root, targets, and snapshot roles, you can rotate them with: + +```bash +$ notary key rotate // +``` + +The Notary CLI client generates a new key for the role you specified, and +prompts you for a passphrase to encrypt it. +Then you're prompted for the passphrase for the key you're rotating, and if it +is correct, the Notary CLI client contacts the Notary server to publish the +change. + +You can also rotate keys that are stored in the Notary server, such as the keys +with the snapshot or timestamp role. For that, run: + +```bash +$ notary key rotate // --server-managed +``` + +## Manage keys for delegation roles + +To delegate image signing to other UCP users, get the `cert.pem` file that's +included in their client bundle and run: + +```bash +$ notary delegation add -p // targets/ --all-paths user1.pem user2.pem +``` + +You can also remove keys from a delegation role: + +```bash +# Remove the given keys from a delegation role +$ notary delegation remove -p // targets/ + +# Alternatively, you can remove keys from all delegation roles +$ notary delegation purge // --key --key +``` + +## Troubleshooting + +Notary CLI has a `-D` flag that you can use to increase the logging level. You +can use this for troubleshooting. + +Usually most problems are fixed by ensuring you're communicating with the +correct Notary server, using the `-s` flag, and that you're using the correct +directory where your private keys are stored, with the `-d` flag. + +## Where to go next + +* [Run only the images you trust](index.md) +* [Get started with Notary](/notary/getting_started.md) diff --git a/datacenter/dtr/2.2/guides/user/manage-images/pull-and-push-images.md b/datacenter/dtr/2.2/guides/user/manage-images/pull-and-push-images.md new file mode 100644 index 0000000000..2be5c3eb13 --- /dev/null +++ b/datacenter/dtr/2.2/guides/user/manage-images/pull-and-push-images.md @@ -0,0 +1,72 @@ +--- +title: Pull and push images +description: Learn how to pull and push images to Docker Trusted Registry. +keywords: docker, registry, push, pull +--- + +You interact with Docker Trusted registry in the same way you interact with +Docker Hub or any other registry: + +* `docker login `: authenticates you on DTR +* `docker pull :`: pulls an image from DTR +* `docker push :`: pushes an image to DTR + +## Pull an image + +Pulling an image from Docker Trusted Registry is the same as pulling an image +from Docker Hub or any other registry. Since DTR is secure by default, you +always need to authenticate before pulling images. + +In this example, DTR can be accessed at dtr.company.org, and the user +was granted permissions to access the Java, Python, and Golang repositories. + +![](../../images/pull-push-images-1.png) + +Click on the repository to see its details. + +![](../../images/pull-push-images-2.png) + +To pull the 1.7 tag of the dave.lauper/golang image, run: + +```bash +$ docker login dtr.company.org +$ docker pull dtr.company.org/dave.lauper/golang:1.7 +``` + +## Push an image + +Before you can push an image to DTR you need to [create a repository](index.md) +to store the image. In this example the full name of our repository is +`dtr.company.org/dave.lauper/golang`. + +## Tag the image + +In this example we'll pull the Golang image from Docker Hub and tag with with +the full DTR and repository name. A tag defines where the image was pulled +from, and where it will be pushed to. + +```bash +# Pull from Docker Hub the 1.7 tag of the golang image +$ docker pull golang:1.7 + +# Tag the golang:1.7 image with the full repository name we've created in DTR +$ docker tag golang:1.7 dtr.company.org/dave.lauper/golang:1.7 +``` + +## Push the image + +Now that you have tagged the image, you only need to authenticate and push the +image to DTR. + +```bash +$ docker login dtr.company.org +$ docker push dtr.company.org/dave.lauper/golang:1.7 +``` + +Go back to the **DTR web UI** to validate that the tag was successfully pushed. + +![](../../images/pull-push-images-3.png) + +## Where to go next + +* [Delete images](delete-images.md) diff --git a/datacenter/dtr/2.2/guides/user/manage-images/scan-images-for-vulnerabilities.md b/datacenter/dtr/2.2/guides/user/manage-images/scan-images-for-vulnerabilities.md new file mode 100644 index 0000000000..11bb8eb14f --- /dev/null +++ b/datacenter/dtr/2.2/guides/user/manage-images/scan-images-for-vulnerabilities.md @@ -0,0 +1,149 @@ +--- +title: Scan images for vulnerabilities +description: Learn how to scan your Docker images for vulnerabilities. +keywords: docker, registry, scan, vulnerability +--- + +[![Image Security Scanning](../../images/scanning_video.png)](https://www.youtube.com/watch?v=121poCB0Nn8 "Images Security Scanning"){:target="_blank"} + +Docker Trusted Registry can scan images in your repositories to verify that they +are free from known security vulnerabilities or exposures, using Docker Security +Scanning. The results of these scans are reported for each image tag. + +Docker Security Scanning is available as an add-on to Docker Trusted Registry, +and an administrator configures it for your DTR instance. If you do not see +security scan results available on your repositories, your organization may not +have purchased the Security Scanning feature or it may be disabled. + +> **Tip**: Only users with write access to a repository can manually start a +scan. Users with read-only access can view the scan results, but cannot start +a new scan. + +## The Docker Security Scan process + +Scans run either on demand when a user clicks the **Start Scan** links or +**Scan** button, or automatically on any `docker push` to the repository. + +First the scanner performs a binary scan on each layer of the image, identifies +the software components in each layer, and indexes the SHA of each component. A +binary scan evaluates the components on a bit-by-bit level, so vulnerable +components are discovered no matter what they're named or statically-linked. + +The scan then compares the SHA of each component against the US National +Vulnerability Database that is installed on your DTR instance. when +this database is updated, DTR reviews the indexed components for newly +discovered vulnerabilities. + +Most scans complete within an hour, however larger repositories may take longer +to scan depending on your system resources. + +## Security scan on push + +By default, Docker Security Scanning runs automatically on `docker push` to an +image repository. + +If your DTR instance is configured in this way, you do not need to do anything +once your `docker push` completes. The scan runs automatically, and the results +are reported in the repository's **Images** tab after the scan finishes. + +## Manual scanning + +If your repository owner enabled Docker Security Scanning but disabled automatic +scanning, you can manually start a scan for images in repositories to which you +have `write` access. + +To start a security scan: + +1. Navigate to the repository. +2. Click the **Images** tab. +3. Locate the image tag that you want to scan. +4. In the **Vulnerabilities** column, click **Start a scan**. + +DTR begins the scanning process. You may need to refresh the page to see the +results once the scan is complete. + +## Change the scanning mode + +You can change the scanning mode for each individual repository at any time. You +might want to disable scanning if you are pushing an image repeatedly during +troubleshooting and don't want to waste resources scanning and re-scanning, or +if a repository contains legacy code that is not used or updated frequently. + +> **Note**: To change an individual repository's scanning mode, you must have +`write` or `administrator` access to the repo. + +To change the repository scanning mode: + +1. Navigate to the repository, and click the **Settings** tab. +2. Scroll down to the **Image scanning** section. +3. Select the desired scanning mode. + +## View security scan results + +Once DTR has run a security scan for an image, you can view the results. + +The **Images** tab for each repository includes a summary of the most recent +scan results for each image. + +- A green shield icon with a check mark indicates that the scan did not find +any vulnerabilities. +- A red or orange shield icon indicates that vulnerabilities were found, and +the number of vulnerabilities is included on that same line. + +If the vulnerability scan can't detect the version of a component, it reports +the vulnerabilities for all versions of that component. + +From the **Images** tab you can click **View details** for a specific tag to see +the full scan results. The top of the page also includes metadata about the +image, including the SHA, image size, date last pushed and user who last pushed, +the security scan summary, and the security scan progress. + +The scan results for each image include two different modes so you can quickly +view details about the image, its components, and any vulnerabilities found. + +- The **Layers** view lists the layers of the image in order as they are built +by the Dockerfile. + + This view can help you find exactly which command in the build introduced + the vulnerabilities, and which components are associated with that single + command. Click a layer to see a summary of its components. You can then + click on a component to switch to the Component view and get more details + about the specific item. + + > **Tip**: The layers view can be long, so be sure + to scroll down if you don't immediately see the reported vulnerabilities. + +- The **Components** view lists the individual component libraries indexed by +the scanning system, in order of severity and number of vulnerabilities found, +most vulnerable first. + + Click on an individual component to view details about the vulnerability it + introduces, including a short summary and a link to the official CVE + database report. A single component can have multiple vulnerabilities, and + the scan report provides details on each one. The component details also + include the license type used by the component, and the filepath to the + component in the image. + +### What do I do next? + +If you find that an image in your registry contains vulnerable components, you +can use the linked CVE scan information in each scan report to evaluate the +vulnerability and decide what to do. + +If you discover vulnerable components, you should check if there is an updated +version available where the security vulnerability has been addressed. If +necessary, you might contact the component's maintainers to ensure that the +vulnerability is being addressed in an a future version or patch update. + +If the vulnerability is in a `base layer` (such as an operating system) you +might not be able to correct the issue in the image. In this case, you might +switch to a different version of the base layer, or you might find an +equivalent, less vulnerable base layer. You might also decide that the +vulnerability or exposure is acceptable. + +Address vulnerabilities in your repositories by updating the images to use +updated and corrected versions of vulnerable components, or by using a different +components that provide the same functionality. When you have updated the source +code, run a build to create a new image, tag the image, and push the updated +image to your DTR instance. You can then re-scan the image to confirm that you +have addressed the vulnerabilities. diff --git a/datacenter/dtr/2.2/reference/api/css/print.css b/datacenter/dtr/2.2/reference/api/css/print.css new file mode 100644 index 0000000000..cd3aa8b6a4 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/css/print.css @@ -0,0 +1,1172 @@ +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ +.swagger-section pre code { + display: block; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section pre code, +.swagger-section pre .subst, +.swagger-section pre .tag .title, +.swagger-section pre .lisp .title, +.swagger-section pre .clojure .built_in, +.swagger-section pre .nginx .title { + color: black; +} +.swagger-section pre .string, +.swagger-section pre .title, +.swagger-section pre .constant, +.swagger-section pre .parent, +.swagger-section pre .tag .value, +.swagger-section pre .rules .value, +.swagger-section pre .rules .value .number, +.swagger-section pre .preprocessor, +.swagger-section pre .ruby .symbol, +.swagger-section pre .ruby .symbol .string, +.swagger-section pre .aggregate, +.swagger-section pre .template_tag, +.swagger-section pre .django .variable, +.swagger-section pre .smalltalk .class, +.swagger-section pre .addition, +.swagger-section pre .flow, +.swagger-section pre .stream, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .apache .cbracket, +.swagger-section pre .tex .command, +.swagger-section pre .tex .special, +.swagger-section pre .erlang_repl .function_or_atom, +.swagger-section pre .markdown .header { + color: #800; +} +.swagger-section pre .comment, +.swagger-section pre .annotation, +.swagger-section pre .template_comment, +.swagger-section pre .diff .header, +.swagger-section pre .chunk, +.swagger-section pre .markdown .blockquote { + color: #888; +} +.swagger-section pre .number, +.swagger-section pre .date, +.swagger-section pre .regexp, +.swagger-section pre .literal, +.swagger-section pre .smalltalk .symbol, +.swagger-section pre .smalltalk .char, +.swagger-section pre .go .constant, +.swagger-section pre .change, +.swagger-section pre .markdown .bullet, +.swagger-section pre .markdown .link_url { + color: #080; +} +.swagger-section pre .label, +.swagger-section pre .javadoc, +.swagger-section pre .ruby .string, +.swagger-section pre .decorator, +.swagger-section pre .filter .argument, +.swagger-section pre .localvars, +.swagger-section pre .array, +.swagger-section pre .attr_selector, +.swagger-section pre .important, +.swagger-section pre .pseudo, +.swagger-section pre .pi, +.swagger-section pre .doctype, +.swagger-section pre .deletion, +.swagger-section pre .envvar, +.swagger-section pre .shebang, +.swagger-section pre .apache .sqbracket, +.swagger-section pre .nginx .built_in, +.swagger-section pre .tex .formula, +.swagger-section pre .erlang_repl .reserved, +.swagger-section pre .prompt, +.swagger-section pre .markdown .link_label, +.swagger-section pre .vhdl .attribute, +.swagger-section pre .clojure .attribute, +.swagger-section pre .coffeescript .property { + color: #8888ff; +} +.swagger-section pre .keyword, +.swagger-section pre .id, +.swagger-section pre .phpdoc, +.swagger-section pre .title, +.swagger-section pre .built_in, +.swagger-section pre .aggregate, +.swagger-section pre .css .tag, +.swagger-section pre .javadoctag, +.swagger-section pre .phpdoc, +.swagger-section pre .yardoctag, +.swagger-section pre .smalltalk .class, +.swagger-section pre .winutils, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .go .typename, +.swagger-section pre .tex .command, +.swagger-section pre .markdown .strong, +.swagger-section pre .request, +.swagger-section pre .status { + font-weight: bold; +} +.swagger-section pre .markdown .emphasis { + font-style: italic; +} +.swagger-section pre .nginx .built_in { + font-weight: normal; +} +.swagger-section pre .coffeescript .javascript, +.swagger-section pre .javascript .xml, +.swagger-section pre .tex .formula, +.swagger-section pre .xml .javascript, +.swagger-section pre .xml .vbscript, +.swagger-section pre .xml .css, +.swagger-section pre .xml .cdata { + opacity: 0.5; +} +.swagger-section .swagger-ui-wrap { + line-height: 1; + font-family: "Droid Sans", sans-serif; + max-width: 960px; + margin-left: auto; + margin-right: auto; +} +.swagger-section .swagger-ui-wrap b, +.swagger-section .swagger-ui-wrap strong { + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap q, +.swagger-section .swagger-ui-wrap blockquote { + quotes: none; +} +.swagger-section .swagger-ui-wrap p { + line-height: 1.4em; + padding: 0 0 10px; + color: #333333; +} +.swagger-section .swagger-ui-wrap q:before, +.swagger-section .swagger-ui-wrap q:after, +.swagger-section .swagger-ui-wrap blockquote:before, +.swagger-section .swagger-ui-wrap blockquote:after { + content: none; +} +.swagger-section .swagger-ui-wrap .heading_with_menu h1, +.swagger-section .swagger-ui-wrap .heading_with_menu h2, +.swagger-section .swagger-ui-wrap .heading_with_menu h3, +.swagger-section .swagger-ui-wrap .heading_with_menu h4, +.swagger-section .swagger-ui-wrap .heading_with_menu h5, +.swagger-section .swagger-ui-wrap .heading_with_menu h6 { + display: block; + clear: none; + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 60%; +} +.swagger-section .swagger-ui-wrap table { + border-collapse: collapse; + border-spacing: 0; +} +.swagger-section .swagger-ui-wrap table thead tr th { + padding: 5px; + font-size: 0.9em; + color: #666666; + border-bottom: 1px solid #999999; +} +.swagger-section .swagger-ui-wrap table tbody tr:last-child td { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap table tbody tr.offset { + background-color: #f0f0f0; +} +.swagger-section .swagger-ui-wrap table tbody tr td { + padding: 6px; + font-size: 0.9em; + border-bottom: 1px solid #cccccc; + vertical-align: top; + line-height: 1.3em; +} +.swagger-section .swagger-ui-wrap ol { + margin: 0px 0 10px; + padding: 0 0 0 18px; + list-style-type: decimal; +} +.swagger-section .swagger-ui-wrap ol li { + padding: 5px 0px; + font-size: 0.9em; + color: #333333; +} +.swagger-section .swagger-ui-wrap ol, +.swagger-section .swagger-ui-wrap ul { + list-style: none; +} +.swagger-section .swagger-ui-wrap h1 a, +.swagger-section .swagger-ui-wrap h2 a, +.swagger-section .swagger-ui-wrap h3 a, +.swagger-section .swagger-ui-wrap h4 a, +.swagger-section .swagger-ui-wrap h5 a, +.swagger-section .swagger-ui-wrap h6 a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap h1 a:hover, +.swagger-section .swagger-ui-wrap h2 a:hover, +.swagger-section .swagger-ui-wrap h3 a:hover, +.swagger-section .swagger-ui-wrap h4 a:hover, +.swagger-section .swagger-ui-wrap h5 a:hover, +.swagger-section .swagger-ui-wrap h6 a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap h1 span.divider, +.swagger-section .swagger-ui-wrap h2 span.divider, +.swagger-section .swagger-ui-wrap h3 span.divider, +.swagger-section .swagger-ui-wrap h4 span.divider, +.swagger-section .swagger-ui-wrap h5 span.divider, +.swagger-section .swagger-ui-wrap h6 span.divider { + color: #aaaaaa; +} +.swagger-section .swagger-ui-wrap a { + color: #547f00; +} +.swagger-section .swagger-ui-wrap a img { + border: none; +} +.swagger-section .swagger-ui-wrap article, +.swagger-section .swagger-ui-wrap aside, +.swagger-section .swagger-ui-wrap details, +.swagger-section .swagger-ui-wrap figcaption, +.swagger-section .swagger-ui-wrap figure, +.swagger-section .swagger-ui-wrap footer, +.swagger-section .swagger-ui-wrap header, +.swagger-section .swagger-ui-wrap hgroup, +.swagger-section .swagger-ui-wrap menu, +.swagger-section .swagger-ui-wrap nav, +.swagger-section .swagger-ui-wrap section, +.swagger-section .swagger-ui-wrap summary { + display: block; +} +.swagger-section .swagger-ui-wrap pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; +} +.swagger-section .swagger-ui-wrap pre code { + line-height: 1.6em; + background: none; +} +.swagger-section .swagger-ui-wrap .content > .content-type > div > label { + clear: both; + display: block; + color: #0F6AB4; + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap .content pre { + font-size: 12px; + margin-top: 5px; + padding: 5px; +} +.swagger-section .swagger-ui-wrap .icon-btn { + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .info_title { + padding-bottom: 10px; + font-weight: bold; + font-size: 25px; +} +.swagger-section .swagger-ui-wrap .footer { + margin-top: 20px; +} +.swagger-section .swagger-ui-wrap p.big, +.swagger-section .swagger-ui-wrap div.big p { + font-size: 1em; + margin-bottom: 10px; +} +.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { + width: 500px !important; +} +.swagger-section .swagger-ui-wrap .info_license { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_tos { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .message-fail { + color: #cc0000; +} +.swagger-section .swagger-ui-wrap .info_url { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_email { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_name { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_description { + padding-bottom: 10px; + font-size: 15px; +} +.swagger-section .swagger-ui-wrap .markdown ol li, +.swagger-section .swagger-ui-wrap .markdown ul li { + padding: 3px 0px; + line-height: 1.4em; + color: #333333; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { + display: block; + padding: 4px; + width: auto; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { + font-size: 1.3em; +} +.swagger-section .swagger-ui-wrap table.fullwidth { + width: 100%; +} +.swagger-section .swagger-ui-wrap .model-signature { + font-family: "Droid Sans", sans-serif; + font-size: 1em; + line-height: 1.5em; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { + text-decoration: none; + color: #AAA; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap .model-signature .propType { + color: #5555aa; +} +.swagger-section .swagger-ui-wrap .model-signature pre:hover { + background-color: #ffffdd; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + font-size: .85em; + line-height: 1.2em; + overflow: auto; + max-height: 200px; + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { + float: left; + margin: 0 5px 5px 0; + padding: 2px 5px 2px 0; + border-right: 1px solid #ddd; +} +.swagger-section .swagger-ui-wrap .model-signature .propOpt { + color: #555; +} +.swagger-section .swagger-ui-wrap .model-signature .snippet small { + font-size: 0.75em; +} +.swagger-section .swagger-ui-wrap .model-signature .propOptKey { + font-style: italic; +} +.swagger-section .swagger-ui-wrap .model-signature .description .strong { + font-weight: bold; + color: #000; + font-size: .9em; +} +.swagger-section .swagger-ui-wrap .model-signature .description div { + font-size: 0.9em; + line-height: 1.5em; + margin-left: 1em; +} +.swagger-section .swagger-ui-wrap .model-signature .description .stronger { + font-weight: bold; + color: #000; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { + border-spacing: 0; + position: absolute; + background-color: #ffffff; + border: 1px solid #bbbbbb; + display: none; + font-size: 11px; + max-width: 400px; + line-height: 30px; + color: black; + padding: 5px; + margin-left: 10px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { + text-align: center; + background-color: #eeeeee; + border: 1px solid #bbbbbb; + font-size: 11px; + color: #666666; + font-weight: bold; + padding: 5px; + line-height: 15px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { + display: inline; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { + display: block; + content: ''; +} +.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { + margin-right: -3px; +} +.swagger-section .swagger-ui-wrap .model-signature .propName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-container { + clear: both; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 300px; + height: 100px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap .markdown p code, +.swagger-section .swagger-ui-wrap .markdown li code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #f0f0f0; + color: black; + padding: 1px 3px; +} +.swagger-section .swagger-ui-wrap .required { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 300px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap h1 { + color: black; + font-size: 1.5em; + line-height: 1.3em; + padding: 10px 0 10px 0; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .heading_with_menu { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap .heading_with_menu ul { + display: block; + clear: none; + float: right; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + margin-top: 10px; +} +.swagger-section .swagger-ui-wrap h2 { + color: black; + font-size: 1.3em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap h2 span.sub { + font-size: 0.7em; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap h2 span.sub a { + color: #777777; +} +.swagger-section .swagger-ui-wrap span.weak { + color: #666666; +} +.swagger-section .swagger-ui-wrap .message-success { + color: #89BF04; +} +.swagger-section .swagger-ui-wrap caption, +.swagger-section .swagger-ui-wrap th, +.swagger-section .swagger-ui-wrap td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +.swagger-section .swagger-ui-wrap .code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { + font-family: "Droid Sans", sans-serif; + height: 250px; + padding: 4px; + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { + display: block; + float: left; + clear: none; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { + display: block; + float: left; + clear: none; + margin: 0 5px 0 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { + color: black; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { + display: block; + clear: both; + width: auto; + padding: 0 0 3px; + color: #666666; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { + padding-left: 3px; + color: #888888; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { + margin-left: 0; + font-style: italic; + font-size: 0.9em; + margin: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap span.blank, +.swagger-section .swagger-ui-wrap span.empty { + color: #888888; + font-style: italic; +} +.swagger-section .swagger-ui-wrap .markdown h3 { + color: #547f00; +} +.swagger-section .swagger-ui-wrap .markdown h4 { + color: #666666; +} +.swagger-section .swagger-ui-wrap .markdown pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; + margin: 0 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown pre code { + line-height: 1.6em; +} +.swagger-section .swagger-ui-wrap div.gist { + margin: 20px 0 25px 0 !important; +} +.swagger-section .swagger-ui-wrap ul#resources { + font-family: "Droid Sans", sans-serif; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource { + border-bottom: 1px solid #dddddd; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { + color: #555555; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { + border: 1px solid transparent; + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 14px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; + color: #666666; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { + color: #aaaaaa; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #999999; + padding-left: 0; + display: block; + clear: none; + float: left; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #999999; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0 0 10px; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { + display: block; + clear: none; + float: left; + width: auto; + margin: 0; + padding: 0; + line-height: 1.1em; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { + padding-left: 10px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { + text-transform: uppercase; + text-decoration: none; + color: white; + display: inline-block; + width: 50px; + font-size: 0.7em; + text-align: center; + padding: 7px 0 4px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 6px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + border-top: none; + padding: 10px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -o-border-bottom-left-radius: 6px; + -ms-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -o-border-bottom-right-radius: 6px; + -ms-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + margin: 0 0 20px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { + padding: 4px 0 0 10px; + display: inline-block; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { + display: block; + clear: none; + float: left; + padding: 6px 8px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { + background-image: url('../images/throbber.gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: right; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { + outline: 2px solid black; + outline-color: #cc0000; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + padding: 10px; + font-size: 0.9em; + max-height: 400px; + overflow-y: auto; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { + background-color: #f9f2e9; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { + background-color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0e0ca; + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { + background-color: #faf5ee; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #ffd20f; + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { + background-color: #f5e8e8; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #e8c6c7; + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + background-color: #f7eded; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { + color: #c8787a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { + background-color: #e7f6ec; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { + background-color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3e8d1; + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { + background-color: #ebf7f0; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { + background-color: #FCE9E3; + border: 1px solid #F5D5C3; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { + background-color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0cecb; + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { + background-color: #faf0ef; + border: 1px solid #f0cecb; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + border-top: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap p#colophon { + margin: 0 15px 40px 15px; + padding: 10px 0; + font-size: 0.8em; + border-top: 1px solid #dddddd; + font-family: "Droid Sans", sans-serif; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap p#colophon a { + text-decoration: none; + color: #547f00; +} +.swagger-section .swagger-ui-wrap h3 { + color: black; + font-size: 1.1em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown ol, +.swagger-section .swagger-ui-wrap .markdown ul { + font-family: "Droid Sans", sans-serif; + margin: 5px 0 10px; + padding: 0 0 0 18px; + list-style-type: disc; +} +.swagger-section .swagger-ui-wrap form.form_box { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box label { + color: #0f6ab4 !important; +} +.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { + display: block; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box p.weak { + font-size: 0.8em; +} +.swagger-section .swagger-ui-wrap form.form_box p { + font-size: 0.9em; + padding: 0 0 15px; + color: #7e7b6d; +} +.swagger-section .swagger-ui-wrap form.form_box p a { + color: #646257; +} +.swagger-section .swagger-ui-wrap form.form_box p strong { + color: black; +} +.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { + padding-bottom: 0; +} +.swagger-section .title { + font-style: bold; +} +.swagger-section .secondary_form { + display: none; +} +.swagger-section .main_image { + display: block; + margin-left: auto; + margin-right: auto; +} +.swagger-section .oauth_body { + margin-left: 100px; + margin-right: 100px; +} +.swagger-section .oauth_submit { + text-align: center; +} +.swagger-section .api-popup-dialog { + z-index: 10000; + position: absolute; + width: 500px; + background: #FFF; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + color: #777; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog p.error-msg { + padding-left: 5px; + padding-bottom: 5px; +} +.swagger-section .api-popup-dialog button.api-popup-authbtn { + height: 30px; +} +.swagger-section .api-popup-dialog button.api-popup-cancel { + height: 30px; +} +.swagger-section .api-popup-scopes { + padding: 10px 20px; +} +.swagger-section .api-popup-scopes li { + padding: 5px 0; + line-height: 20px; +} +.swagger-section .api-popup-scopes .api-scope-desc { + padding-left: 20px; + font-style: italic; +} +.swagger-section .api-popup-scopes li input { + position: relative; + top: 2px; +} +.swagger-section .api-popup-actions { + padding-top: 10px; +} +#header { + display: none; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + max-height: none; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 100px; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 100px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + display: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints { + display: block !important; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + display: block !important; +} diff --git a/datacenter/dtr/2.2/reference/api/css/reset.css b/datacenter/dtr/2.2/reference/api/css/reset.css new file mode 100644 index 0000000000..b2b078943c --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/css/reset.css @@ -0,0 +1,125 @@ +/* http://meyerweb.com/eric/tools/css/reset/ v2.0 | 20110126 */ +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { + display: block; +} +body { + line-height: 1; +} +ol, +ul { + list-style: none; +} +blockquote, +q { + quotes: none; +} +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/datacenter/dtr/2.2/reference/api/css/screen.css b/datacenter/dtr/2.2/reference/api/css/screen.css new file mode 100644 index 0000000000..436cc28edd --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/css/screen.css @@ -0,0 +1,1279 @@ +/* Original style from softwaremaniacs.org (c) Ivan Sagalaev */ +.swagger-section pre code { + display: block; + padding: 0.5em; + background: #F0F0F0; +} +.swagger-section pre code, +.swagger-section pre .subst, +.swagger-section pre .tag .title, +.swagger-section pre .lisp .title, +.swagger-section pre .clojure .built_in, +.swagger-section pre .nginx .title { + color: black; +} +.swagger-section pre .string, +.swagger-section pre .title, +.swagger-section pre .constant, +.swagger-section pre .parent, +.swagger-section pre .tag .value, +.swagger-section pre .rules .value, +.swagger-section pre .rules .value .number, +.swagger-section pre .preprocessor, +.swagger-section pre .ruby .symbol, +.swagger-section pre .ruby .symbol .string, +.swagger-section pre .aggregate, +.swagger-section pre .template_tag, +.swagger-section pre .django .variable, +.swagger-section pre .smalltalk .class, +.swagger-section pre .addition, +.swagger-section pre .flow, +.swagger-section pre .stream, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .apache .cbracket, +.swagger-section pre .tex .command, +.swagger-section pre .tex .special, +.swagger-section pre .erlang_repl .function_or_atom, +.swagger-section pre .markdown .header { + color: #800; +} +.swagger-section pre .comment, +.swagger-section pre .annotation, +.swagger-section pre .template_comment, +.swagger-section pre .diff .header, +.swagger-section pre .chunk, +.swagger-section pre .markdown .blockquote { + color: #888; +} +.swagger-section pre .number, +.swagger-section pre .date, +.swagger-section pre .regexp, +.swagger-section pre .literal, +.swagger-section pre .smalltalk .symbol, +.swagger-section pre .smalltalk .char, +.swagger-section pre .go .constant, +.swagger-section pre .change, +.swagger-section pre .markdown .bullet, +.swagger-section pre .markdown .link_url { + color: #080; +} +.swagger-section pre .label, +.swagger-section pre .javadoc, +.swagger-section pre .ruby .string, +.swagger-section pre .decorator, +.swagger-section pre .filter .argument, +.swagger-section pre .localvars, +.swagger-section pre .array, +.swagger-section pre .attr_selector, +.swagger-section pre .important, +.swagger-section pre .pseudo, +.swagger-section pre .pi, +.swagger-section pre .doctype, +.swagger-section pre .deletion, +.swagger-section pre .envvar, +.swagger-section pre .shebang, +.swagger-section pre .apache .sqbracket, +.swagger-section pre .nginx .built_in, +.swagger-section pre .tex .formula, +.swagger-section pre .erlang_repl .reserved, +.swagger-section pre .prompt, +.swagger-section pre .markdown .link_label, +.swagger-section pre .vhdl .attribute, +.swagger-section pre .clojure .attribute, +.swagger-section pre .coffeescript .property { + color: #8888ff; +} +.swagger-section pre .keyword, +.swagger-section pre .id, +.swagger-section pre .phpdoc, +.swagger-section pre .title, +.swagger-section pre .built_in, +.swagger-section pre .aggregate, +.swagger-section pre .css .tag, +.swagger-section pre .javadoctag, +.swagger-section pre .phpdoc, +.swagger-section pre .yardoctag, +.swagger-section pre .smalltalk .class, +.swagger-section pre .winutils, +.swagger-section pre .bash .variable, +.swagger-section pre .apache .tag, +.swagger-section pre .go .typename, +.swagger-section pre .tex .command, +.swagger-section pre .markdown .strong, +.swagger-section pre .request, +.swagger-section pre .status { + font-weight: bold; +} +.swagger-section pre .markdown .emphasis { + font-style: italic; +} +.swagger-section pre .nginx .built_in { + font-weight: normal; +} +.swagger-section pre .coffeescript .javascript, +.swagger-section pre .javascript .xml, +.swagger-section pre .tex .formula, +.swagger-section pre .xml .javascript, +.swagger-section pre .xml .vbscript, +.swagger-section pre .xml .css, +.swagger-section pre .xml .cdata { + opacity: 0.5; +} +.swagger-section .swagger-ui-wrap { + line-height: 1; + font-family: "Droid Sans", sans-serif; + max-width: 960px; + margin-left: auto; + margin-right: auto; +} +.swagger-section .swagger-ui-wrap b, +.swagger-section .swagger-ui-wrap strong { + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap q, +.swagger-section .swagger-ui-wrap blockquote { + quotes: none; +} +.swagger-section .swagger-ui-wrap p { + line-height: 1.4em; + padding: 0 0 10px; + color: #333333; +} +.swagger-section .swagger-ui-wrap q:before, +.swagger-section .swagger-ui-wrap q:after, +.swagger-section .swagger-ui-wrap blockquote:before, +.swagger-section .swagger-ui-wrap blockquote:after { + content: none; +} +.swagger-section .swagger-ui-wrap .heading_with_menu h1, +.swagger-section .swagger-ui-wrap .heading_with_menu h2, +.swagger-section .swagger-ui-wrap .heading_with_menu h3, +.swagger-section .swagger-ui-wrap .heading_with_menu h4, +.swagger-section .swagger-ui-wrap .heading_with_menu h5, +.swagger-section .swagger-ui-wrap .heading_with_menu h6 { + display: block; + clear: none; + float: left; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + width: 60%; +} +.swagger-section .swagger-ui-wrap table { + border-collapse: collapse; + border-spacing: 0; +} +.swagger-section .swagger-ui-wrap table thead tr th { + padding: 5px; + font-size: 0.9em; + color: #666666; + border-bottom: 1px solid #999999; +} +.swagger-section .swagger-ui-wrap table tbody tr:last-child td { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap table tbody tr.offset { + background-color: #f0f0f0; +} +.swagger-section .swagger-ui-wrap table tbody tr td { + padding: 6px; + font-size: 0.9em; + border-bottom: 1px solid #cccccc; + vertical-align: top; + line-height: 1.3em; +} +.swagger-section .swagger-ui-wrap ol { + margin: 0px 0 10px; + padding: 0 0 0 18px; + list-style-type: decimal; +} +.swagger-section .swagger-ui-wrap ol li { + padding: 5px 0px; + font-size: 0.9em; + color: #333333; +} +.swagger-section .swagger-ui-wrap ol, +.swagger-section .swagger-ui-wrap ul { + list-style: none; +} +.swagger-section .swagger-ui-wrap h1 a, +.swagger-section .swagger-ui-wrap h2 a, +.swagger-section .swagger-ui-wrap h3 a, +.swagger-section .swagger-ui-wrap h4 a, +.swagger-section .swagger-ui-wrap h5 a, +.swagger-section .swagger-ui-wrap h6 a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap h1 a:hover, +.swagger-section .swagger-ui-wrap h2 a:hover, +.swagger-section .swagger-ui-wrap h3 a:hover, +.swagger-section .swagger-ui-wrap h4 a:hover, +.swagger-section .swagger-ui-wrap h5 a:hover, +.swagger-section .swagger-ui-wrap h6 a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap h1 span.divider, +.swagger-section .swagger-ui-wrap h2 span.divider, +.swagger-section .swagger-ui-wrap h3 span.divider, +.swagger-section .swagger-ui-wrap h4 span.divider, +.swagger-section .swagger-ui-wrap h5 span.divider, +.swagger-section .swagger-ui-wrap h6 span.divider { + color: #aaaaaa; +} +.swagger-section .swagger-ui-wrap a { + color: #547f00; +} +.swagger-section .swagger-ui-wrap a img { + border: none; +} +.swagger-section .swagger-ui-wrap article, +.swagger-section .swagger-ui-wrap aside, +.swagger-section .swagger-ui-wrap details, +.swagger-section .swagger-ui-wrap figcaption, +.swagger-section .swagger-ui-wrap figure, +.swagger-section .swagger-ui-wrap footer, +.swagger-section .swagger-ui-wrap header, +.swagger-section .swagger-ui-wrap hgroup, +.swagger-section .swagger-ui-wrap menu, +.swagger-section .swagger-ui-wrap nav, +.swagger-section .swagger-ui-wrap section, +.swagger-section .swagger-ui-wrap summary { + display: block; +} +.swagger-section .swagger-ui-wrap pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; +} +.swagger-section .swagger-ui-wrap pre code { + line-height: 1.6em; + background: none; +} +.swagger-section .swagger-ui-wrap .content > .content-type > div > label { + clear: both; + display: block; + color: #0F6AB4; + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap .content pre { + font-size: 12px; + margin-top: 5px; + padding: 5px; +} +.swagger-section .swagger-ui-wrap .icon-btn { + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .info_title { + padding-bottom: 10px; + font-weight: bold; + font-size: 25px; +} +.swagger-section .swagger-ui-wrap .footer { + margin-top: 20px; +} +.swagger-section .swagger-ui-wrap p.big, +.swagger-section .swagger-ui-wrap div.big p { + font-size: 1em; + margin-bottom: 10px; +} +.swagger-section .swagger-ui-wrap form.fullwidth ol li.string input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.url input, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.text textarea, +.swagger-section .swagger-ui-wrap form.fullwidth ol li.numeric input { + width: 500px !important; +} +.swagger-section .swagger-ui-wrap .info_license { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_tos { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .message-fail { + color: #cc0000; +} +.swagger-section .swagger-ui-wrap .info_url { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_email { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_name { + padding-bottom: 5px; +} +.swagger-section .swagger-ui-wrap .info_description { + padding-bottom: 10px; + font-size: 15px; +} +.swagger-section .swagger-ui-wrap .markdown ol li, +.swagger-section .swagger-ui-wrap .markdown ul li { + padding: 3px 0px; + line-height: 1.4em; + color: #333333; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input { + display: block; + padding: 4px; + width: auto; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.string input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.url input.title, +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.numeric input.title { + font-size: 1.3em; +} +.swagger-section .swagger-ui-wrap table.fullwidth { + width: 100%; +} +.swagger-section .swagger-ui-wrap .model-signature { + font-family: "Droid Sans", sans-serif; + font-size: 1em; + line-height: 1.5em; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a { + text-decoration: none; + color: #AAA; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-nav .selected { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap .model-signature .propType { + color: #5555aa; +} +.swagger-section .swagger-ui-wrap .model-signature pre:hover { + background-color: #ffffdd; +} +.swagger-section .swagger-ui-wrap .model-signature pre { + font-size: .85em; + line-height: 1.2em; + overflow: auto; + max-height: 200px; + cursor: pointer; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li:last-child { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav li { + float: left; + margin: 0 5px 5px 0; + padding: 2px 5px 2px 0; + border-right: 1px solid #ddd; +} +.swagger-section .swagger-ui-wrap .model-signature .propOpt { + color: #555; +} +.swagger-section .swagger-ui-wrap .model-signature .snippet small { + font-size: 0.75em; +} +.swagger-section .swagger-ui-wrap .model-signature .propOptKey { + font-style: italic; +} +.swagger-section .swagger-ui-wrap .model-signature .description .strong { + font-weight: bold; + color: #000; + font-size: .9em; +} +.swagger-section .swagger-ui-wrap .model-signature .description div { + font-size: 0.9em; + line-height: 1.5em; + margin-left: 1em; +} +.swagger-section .swagger-ui-wrap .model-signature .description .stronger { + font-weight: bold; + color: #000; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper { + border-spacing: 0; + position: absolute; + background-color: #ffffff; + border: 1px solid #bbbbbb; + display: none; + font-size: 11px; + max-width: 400px; + line-height: 30px; + color: black; + padding: 5px; + margin-left: 10px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper th { + text-align: center; + background-color: #eeeeee; + border: 1px solid #bbbbbb; + font-size: 11px; + color: #666666; + font-weight: bold; + padding: 5px; + line-height: 15px; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propWrap .optionsWrapper .optionName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:first-child, +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:last-child { + display: inline; +} +.swagger-section .swagger-ui-wrap .model-signature .description .propDesc.markdown > p:not(:first-child):before { + display: block; + content: ''; +} +.swagger-section .swagger-ui-wrap .model-signature .description span:last-of-type.propDesc.markdown > p:only-child { + margin-right: -3px; +} +.swagger-section .swagger-ui-wrap .model-signature .propName { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .model-signature .signature-container { + clear: both; +} +.swagger-section .swagger-ui-wrap .body-textarea { + width: 300px; + height: 100px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap .markdown p code, +.swagger-section .swagger-ui-wrap .markdown li code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #f0f0f0; + color: black; + padding: 1px 3px; +} +.swagger-section .swagger-ui-wrap .required { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap input.parameter { + width: 300px; + border: 1px solid #aaa; +} +.swagger-section .swagger-ui-wrap h1 { + color: black; + font-size: 1.5em; + line-height: 1.3em; + padding: 10px 0 10px 0; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap .heading_with_menu { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap .heading_with_menu ul { + display: block; + clear: none; + float: right; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + -ms-box-sizing: border-box; + box-sizing: border-box; + margin-top: 10px; +} +.swagger-section .swagger-ui-wrap h2 { + color: black; + font-size: 1.3em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap h2 span.sub { + font-size: 0.7em; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap h2 span.sub a { + color: #777777; +} +.swagger-section .swagger-ui-wrap span.weak { + color: #666666; +} +.swagger-section .swagger-ui-wrap .message-success { + color: #89BF04; +} +.swagger-section .swagger-ui-wrap caption, +.swagger-section .swagger-ui-wrap th, +.swagger-section .swagger-ui-wrap td { + text-align: left; + font-weight: normal; + vertical-align: middle; +} +.swagger-section .swagger-ui-wrap .code { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.text textarea { + font-family: "Droid Sans", sans-serif; + height: 250px; + padding: 4px; + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.select select { + display: block; + clear: both; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean label { + display: block; + float: left; + clear: none; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.boolean input { + display: block; + float: left; + clear: none; + margin: 0 5px 0 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li.required label { + color: black; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label { + display: block; + clear: both; + width: auto; + padding: 0 0 3px; + color: #666666; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li label abbr { + padding-left: 3px; + color: #888888; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.inputs ol li p.inline-hints { + margin-left: 0; + font-style: italic; + font-size: 0.9em; + margin: 0; +} +.swagger-section .swagger-ui-wrap form.formtastic fieldset.buttons { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap span.blank, +.swagger-section .swagger-ui-wrap span.empty { + color: #888888; + font-style: italic; +} +.swagger-section .swagger-ui-wrap .markdown h3 { + color: #547f00; +} +.swagger-section .swagger-ui-wrap .markdown h4 { + color: #666666; +} +.swagger-section .swagger-ui-wrap .markdown pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + padding: 10px; + margin: 0 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown pre code { + line-height: 1.6em; +} +.swagger-section .swagger-ui-wrap div.gist { + margin: 20px 0 25px 0 !important; +} +.swagger-section .swagger-ui-wrap ul#resources { + font-family: "Droid Sans", sans-serif; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource { + border-bottom: 1px solid #dddddd; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading h2 a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading h2 a { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:hover div.heading ul.options li a, +.swagger-section .swagger-ui-wrap ul#resources li.resource.active div.heading ul.options li a { + color: #555555; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource:last-child { + border-bottom: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading { + border: 1px solid transparent; + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 14px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + border-right: 1px solid #dddddd; + color: #666666; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a { + color: #aaaaaa; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover { + text-decoration: underline; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading ul.options.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #999999; + padding-left: 0; + display: block; + clear: none; + float: left; + font-family: "Droid Sans", sans-serif; + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #999999; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0 0 10px; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading { + float: none; + clear: both; + overflow: hidden; + display: block; + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 { + display: block; + clear: none; + float: left; + width: auto; + margin: 0; + padding: 0; + line-height: 1.1em; + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path { + padding-left: 10px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a { + color: black; + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.http_method a { + text-transform: uppercase; + text-decoration: none; + color: white; + display: inline-block; + width: 50px; + font-size: 0.7em; + text-align: center; + padding: 7px 0 4px; + -moz-border-radius: 2px; + -webkit-border-radius: 2px; + -o-border-radius: 2px; + -ms-border-radius: 2px; + -khtml-border-radius: 2px; + border-radius: 2px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span { + margin: 0; + padding: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options { + overflow: hidden; + padding: 0; + display: block; + clear: none; + float: right; + margin: 6px 10px 0 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li { + float: left; + clear: none; + margin: 0; + padding: 2px 10px; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a { + text-decoration: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content { + border-top: none; + padding: 10px; + -moz-border-radius-bottomleft: 6px; + -webkit-border-bottom-left-radius: 6px; + -o-border-bottom-left-radius: 6px; + -ms-border-bottom-left-radius: 6px; + -khtml-border-bottom-left-radius: 6px; + border-bottom-left-radius: 6px; + -moz-border-radius-bottomright: 6px; + -webkit-border-bottom-right-radius: 6px; + -o-border-bottom-right-radius: 6px; + -ms-border-bottom-right-radius: 6px; + -khtml-border-bottom-right-radius: 6px; + border-bottom-right-radius: 6px; + margin: 0 0 20px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h4 { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header { + float: none; + clear: both; + overflow: hidden; + display: block; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header a { + padding: 4px 0 0 10px; + display: inline-block; + font-size: 0.9em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header input.submit { + display: block; + clear: none; + float: left; + padding: 6px 8px; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.sandbox_header span.response_throbber { + background-image: url('../images/throbber.gif'); + width: 128px; + height: 16px; + display: block; + clear: none; + float: right; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content form input[type='text'].error { + outline: 2px solid black; + outline-color: #cc0000; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content div.response div.block pre { + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + padding: 10px; + font-size: 0.9em; + max-height: 400px; + overflow-y: auto; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading { + background-color: #f9f2e9; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading h3 span.http_method a { + background-color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0e0ca; + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li a { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content { + background-color: #faf5ee; + border: 1px solid #f0e0ca; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content h4 { + color: #c5862b; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #ffd20f; + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li a { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content { + background-color: #fcffcd; + border: 1px solid black; + border-color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content h4 { + color: #ffd20f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading { + background-color: #f5e8e8; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading h3 span.http_method a { + text-transform: uppercase; + background-color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #e8c6c7; + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li a { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + background-color: #f7eded; + border: 1px solid #e8c6c7; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content h4 { + color: #a41e22; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content div.sandbox_header a { + color: #c8787a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading { + background-color: #e7f6ec; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading h3 span.http_method a { + background-color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3e8d1; + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li a { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content { + background-color: #ebf7f0; + border: 1px solid #c3e8d1; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h4 { + color: #10a54a; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content div.sandbox_header a { + color: #6fc992; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading { + background-color: #FCE9E3; + border: 1px solid #F5D5C3; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading h3 span.http_method a { + background-color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #f0cecb; + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li a { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content { + background-color: #faf0ef; + border: 1px solid #f0cecb; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content h4 { + color: #D38042; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content div.sandbox_header a { + color: #dcb67f; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading { + background-color: #e7f0f7; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading h3 span.http_method a { + background-color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li { + border-right: 1px solid #dddddd; + border-right-color: #c3d9ec; + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.heading ul.options li a { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content h4 { + color: #0f6ab4; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.options div.content div.sandbox_header a { + color: #6fa5d2; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.content, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.content { + border-top: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li:last-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.get div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.head div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.put div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.patch div.heading ul.options li.last, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.delete div.heading ul.options li.last { + padding-right: 0; + border-right: none; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:hover, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a:active, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li a.active { + text-decoration: underline; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations ul.options li.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations:first-child, +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations.first { + padding-left: 0; +} +.swagger-section .swagger-ui-wrap p#colophon { + margin: 0 15px 40px 15px; + padding: 10px 0; + font-size: 0.8em; + border-top: 1px solid #dddddd; + font-family: "Droid Sans", sans-serif; + color: #999999; + font-style: italic; +} +.swagger-section .swagger-ui-wrap p#colophon a { + text-decoration: none; + color: #547f00; +} +.swagger-section .swagger-ui-wrap h3 { + color: black; + font-size: 1.1em; + padding: 10px 0 10px 0; +} +.swagger-section .swagger-ui-wrap .markdown ol, +.swagger-section .swagger-ui-wrap .markdown ul { + font-family: "Droid Sans", sans-serif; + margin: 5px 0 10px; + padding: 0 0 0 18px; + list-style-type: disc; +} +.swagger-section .swagger-ui-wrap form.form_box { + background-color: #ebf3f9; + border: 1px solid #c3d9ec; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box label { + color: #0f6ab4 !important; +} +.swagger-section .swagger-ui-wrap form.form_box input[type=submit] { + display: block; + padding: 10px; +} +.swagger-section .swagger-ui-wrap form.form_box p.weak { + font-size: 0.8em; +} +.swagger-section .swagger-ui-wrap form.form_box p { + font-size: 0.9em; + padding: 0 0 15px; + color: #7e7b6d; +} +.swagger-section .swagger-ui-wrap form.form_box p a { + color: #646257; +} +.swagger-section .swagger-ui-wrap form.form_box p strong { + color: black; +} +.swagger-section .swagger-ui-wrap .operation-status td.markdown > p:last-child { + padding-bottom: 0; +} +.swagger-section .title { + font-style: bold; +} +.swagger-section .secondary_form { + display: none; +} +.swagger-section .main_image { + display: block; + margin-left: auto; + margin-right: auto; +} +.swagger-section .oauth_body { + margin-left: 100px; + margin-right: 100px; +} +.swagger-section .oauth_submit { + text-align: center; +} +.swagger-section .api-popup-dialog { + z-index: 10000; + position: absolute; + width: 500px; + background: #FFF; + padding: 20px; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + color: #777; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog .api-popup-title { + font-size: 24px; + padding: 10px 0; +} +.swagger-section .api-popup-dialog p.error-msg { + padding-left: 5px; + padding-bottom: 5px; +} +.swagger-section .api-popup-dialog button.api-popup-authbtn { + height: 30px; +} +.swagger-section .api-popup-dialog button.api-popup-cancel { + height: 30px; +} +.swagger-section .api-popup-scopes { + padding: 10px 20px; +} +.swagger-section .api-popup-scopes li { + padding: 5px 0; + line-height: 20px; +} +.swagger-section .api-popup-scopes .api-scope-desc { + padding-left: 20px; + font-style: italic; +} +.swagger-section .api-popup-scopes li input { + position: relative; + top: 2px; +} +.swagger-section .api-popup-actions { + padding-top: 10px; +} +.swagger-section .access { + float: right; +} +.swagger-section .auth { + float: right; +} +.swagger-section .api-ic { + height: 18px; + vertical-align: middle; + display: inline-block; + background: url(../images/explorer_icons.png) no-repeat; +} +.swagger-section .api-ic .api_information_panel { + position: relative; + margin-top: 20px; + margin-left: -5px; + background: #FFF; + border: 1px solid #ccc; + border-radius: 5px; + display: none; + font-size: 13px; + max-width: 300px; + line-height: 30px; + color: black; + padding: 5px; +} +.swagger-section .api-ic .api_information_panel p .api-msg-enabled { + color: green; +} +.swagger-section .api-ic .api_information_panel p .api-msg-disabled { + color: red; +} +.swagger-section .api-ic:hover .api_information_panel { + position: absolute; + display: block; +} +.swagger-section .ic-info { + background-position: 0 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-warning { + background-position: -60px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-error { + background-position: -30px 0; + width: 18px; + margin-top: -6px; + margin-left: 4px; +} +.swagger-section .ic-off { + background-position: -90px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section .ic-on { + background-position: -160px 0; + width: 58px; + margin-top: -4px; + cursor: pointer; +} +.swagger-section #header { + background-color: #89bf04; + padding: 14px; +} +.swagger-section #header a#logo { + font-size: 1.5em; + font-weight: bold; + text-decoration: none; + background: transparent url(../images/logo_small.png) no-repeat left center; + padding: 20px 0 20px 40px; + color: white; +} +.swagger-section #header form#api_selector { + display: block; + clear: none; + float: right; +} +.swagger-section #header form#api_selector .input { + display: block; + clear: none; + float: left; + margin: 0 10px 0 0; +} +.swagger-section #header form#api_selector .input input#input_apiKey { + width: 200px; +} +.swagger-section #header form#api_selector .input input#input_baseUrl { + width: 400px; +} +.swagger-section #header form#api_selector .input a#explore { + display: block; + text-decoration: none; + font-weight: bold; + padding: 6px 8px; + font-size: 0.9em; + color: white; + background-color: #547f00; + -moz-border-radius: 4px; + -webkit-border-radius: 4px; + -o-border-radius: 4px; + -ms-border-radius: 4px; + -khtml-border-radius: 4px; + border-radius: 4px; +} +.swagger-section #header form#api_selector .input a#explore:hover { + background-color: #547f00; +} +.swagger-section #header form#api_selector .input input { + font-size: 0.9em; + padding: 3px; + margin: 0; +} +.swagger-section #content_message { + margin: 10px 15px; + font-style: italic; + color: #999999; +} +.swagger-section #message-bar { + min-height: 30px; + text-align: center; + padding-top: 10px; +} diff --git a/datacenter/dtr/2.2/reference/api/css/style.css b/datacenter/dtr/2.2/reference/api/css/style.css new file mode 100644 index 0000000000..fc21a31db5 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/css/style.css @@ -0,0 +1,250 @@ +.swagger-section #header a#logo { + font-size: 1.5em; + font-weight: bold; + text-decoration: none; + background: transparent url(../images/logo.png) no-repeat left center; + padding: 20px 0 20px 40px; +} +#text-head { + font-size: 80px; + font-family: 'Roboto', sans-serif; + color: #ffffff; + float: right; + margin-right: 20%; +} +.navbar-fixed-top .navbar-nav { + height: auto; +} +.navbar-fixed-top .navbar-brand { + height: auto; +} +.navbar-header { + height: auto; +} +.navbar-inverse { + background-color: #000; + border-color: #000; +} +#navbar-brand { + margin-left: 20%; +} +.navtext { + font-size: 10px; +} +.h1, +h1 { + font-size: 60px; +} +.navbar-default .navbar-header .navbar-brand { + color: #a2dfee; +} +/* tag titles */ +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a { + color: #393939; + font-family: 'Arvo', serif; + font-size: 1.5em; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 a:hover { + color: black; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource div.heading h2 { + color: #525252; + padding-left: 0px; + display: block; + clear: none; + float: left; + font-family: 'Arvo', serif; + font-weight: bold; +} +.navbar-default .navbar-collapse, +.navbar-default .navbar-form { + border-color: #0A0A0A; +} +.container1 { + width: 1500px; + margin: auto; + margin-top: 0; + background-image: url('../images/shield.png'); + background-repeat: no-repeat; + background-position: -40px -20px; + margin-bottom: 210px; +} +.container-inner { + width: 1200px; + margin: auto; + background-color: rgba(223, 227, 228, 0.75); + padding-bottom: 40px; + padding-top: 40px; + border-radius: 15px; +} +.header-content { + padding: 0; + width: 1000px; +} +.title1 { + font-size: 80px; + font-family: 'Vollkorn', serif; + color: #404040; + text-align: center; + padding-top: 40px; + padding-bottom: 100px; +} +#icon { + margin-top: -18px; +} +.subtext { + font-size: 25px; + font-style: italic; + color: #08b; + text-align: right; + padding-right: 250px; +} +.bg-primary { + background-color: #00468b; +} +.navbar-default .nav > li > a, +.navbar-default .nav > li > a:focus { + color: #08b; +} +.navbar-default .nav > li > a, +.navbar-default .nav > li > a:hover { + color: #08b; +} +.navbar-default .nav > li > a, +.navbar-default .nav > li > a:focus:hover { + color: #08b; +} +.text-faded { + font-size: 25px; + font-family: 'Vollkorn', serif; +} +.section-heading { + font-family: 'Vollkorn', serif; + font-size: 45px; + padding-bottom: 10px; +} +hr { + border-color: #00468b; + padding-bottom: 10px; +} +.description { + margin-top: 20px; + padding-bottom: 200px; +} +.description li { + font-family: 'Vollkorn', serif; + font-size: 25px; + color: #525252; + margin-left: 28%; + padding-top: 5px; +} +.gap { + margin-top: 200px; +} +.troubleshootingtext { + color: rgba(255, 255, 255, 0.7); + padding-left: 30%; +} +.troubleshootingtext li { + list-style-type: circle; + font-size: 25px; + padding-bottom: 5px; +} +.overlay { + position: absolute; + top: 0; + left: 0; + width: 100%; + height: 100%; + z-index: 1000; +} +.block.response_body.json:hover { + cursor: pointer; +} +.backdrop { + color: blue; +} +#myModal { + height: 100%; +} +.modal-backdrop { + bottom: 0; + position: fixed; +} +.curl { + padding: 10px; + font-family: "Anonymous Pro", "Menlo", "Consolas", "Bitstream Vera Sans Mono", "Courier New", monospace; + font-size: 0.9em; + max-height: 400px; + margin-top: 5px; + overflow-y: auto; + background-color: #fcf6db; + border: 1px solid #e5e0c6; + border-radius: 4px; +} +.curl_title { + font-size: 1.1em; + margin: 0; + padding: 15px 0 5px; + font-family: 'Open Sans', 'Helvetica Neue', Arial, sans-serif; + font-weight: 500; + line-height: 1.1; +} +.footer { + display: none; +} +.swagger-section .swagger-ui-wrap h2 { + padding: 0; +} +h2 { + margin: 0; + margin-bottom: 5px; +} +.markdown p { + font-size: 15px; + font-family: 'Arvo', serif; +} +.swagger-section .swagger-ui-wrap .code { + font-size: 15px; + font-family: 'Arvo', serif; +} +.swagger-section .swagger-ui-wrap b { + font-family: 'Arvo', serif; +} +#signin:hover { + cursor: pointer; +} +.dropdown-menu { + padding: 15px; +} +.navbar-right .dropdown-menu { + left: 0; + right: auto; +} +#signinbutton { + width: 100%; + height: 32px; + font-size: 13px; + font-weight: bold; + color: #08b; +} +.navbar-default .nav > li .details { + color: #000000; + text-transform: none; + font-size: 15px; + font-weight: normal; + font-family: 'Open Sans', sans-serif; + font-style: italic; + line-height: 20px; + top: -2px; +} +.navbar-default .nav > li .details:hover { + color: black; +} +#signout { + width: 100%; + height: 32px; + font-size: 13px; + font-weight: bold; + color: #08b; +} diff --git a/datacenter/dtr/2.2/reference/api/css/typography.css b/datacenter/dtr/2.2/reference/api/css/typography.css new file mode 100644 index 0000000000..27c3751ac2 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/css/typography.css @@ -0,0 +1,26 @@ +/* droid-sans-regular - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 400; + src: url('../fonts/droid-sans-v6-latin-regular.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans'), local('DroidSans'), + url('../fonts/droid-sans-v6-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-regular.svg#DroidSans') format('svg'); /* Legacy iOS */ +} +/* droid-sans-700 - latin */ +@font-face { + font-family: 'Droid Sans'; + font-style: normal; + font-weight: 700; + src: url('../fonts/droid-sans-v6-latin-700.eot'); /* IE9 Compat Modes */ + src: local('Droid Sans Bold'), local('DroidSans-Bold'), + url('../fonts/droid-sans-v6-latin-700.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */ + url('../fonts/droid-sans-v6-latin-700.woff2') format('woff2'), /* Super Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.woff') format('woff'), /* Modern Browsers */ + url('../fonts/droid-sans-v6-latin-700.ttf') format('truetype'), /* Safari, Android, iOS */ + url('../fonts/droid-sans-v6-latin-700.svg#DroidSans') format('svg'); /* Legacy iOS */ +} diff --git a/datacenter/dtr/2.2/reference/api/custom/custom.css b/datacenter/dtr/2.2/reference/api/custom/custom.css new file mode 100644 index 0000000000..c365077de3 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/custom/custom.css @@ -0,0 +1,15 @@ +em { + font-weight: bold; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation.post div.content h5 { + color: #10654A; +} +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content h5 { + font-size: 1.0em; + margin: 0px; + padding: 15px 0px 5px; +} + +.swagger-section .swagger-ui-wrap table tr td:nth-child(2) textarea { + display: none !important; +} diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.eot b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.eot new file mode 100644 index 0000000000..d8524983ad Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.eot differ diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.svg b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.svg new file mode 100644 index 0000000000..a54bbbbf25 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.svg @@ -0,0 +1,411 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.ttf b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.ttf new file mode 100644 index 0000000000..15896c441f Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.ttf differ diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.woff b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.woff new file mode 100644 index 0000000000..67e3e25f83 Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.woff differ diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.woff2 b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.woff2 new file mode 100644 index 0000000000..1e726a7cfc Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-700.woff2 differ diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.eot b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.eot new file mode 100644 index 0000000000..ac2698e85a Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.eot differ diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.svg b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.svg new file mode 100644 index 0000000000..d9f2a214f9 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.svg @@ -0,0 +1,403 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.ttf b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.ttf new file mode 100644 index 0000000000..fb8cea662b Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.ttf differ diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.woff b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.woff new file mode 100644 index 0000000000..abf19899f7 Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.woff differ diff --git a/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.woff2 b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.woff2 new file mode 100644 index 0000000000..9f93f74c3b Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/fonts/droid-sans-v6-latin-regular.woff2 differ diff --git a/datacenter/dtr/2.2/reference/api/images/explorer_icons.png b/datacenter/dtr/2.2/reference/api/images/explorer_icons.png new file mode 100644 index 0000000000..ed9d2fffb6 Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/images/explorer_icons.png differ diff --git a/datacenter/dtr/2.2/reference/api/images/favicon-16x16.png b/datacenter/dtr/2.2/reference/api/images/favicon-16x16.png new file mode 100755 index 0000000000..66b1a5bfb9 Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/images/favicon-16x16.png differ diff --git a/datacenter/dtr/2.2/reference/api/images/favicon-32x32.png b/datacenter/dtr/2.2/reference/api/images/favicon-32x32.png new file mode 100755 index 0000000000..32f319f89b Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/images/favicon-32x32.png differ diff --git a/datacenter/dtr/2.2/reference/api/images/favicon.ico b/datacenter/dtr/2.2/reference/api/images/favicon.ico new file mode 100755 index 0000000000..8b60bcf06a Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/images/favicon.ico differ diff --git a/datacenter/dtr/2.2/reference/api/images/logo_small.png b/datacenter/dtr/2.2/reference/api/images/logo_small.png new file mode 100644 index 0000000000..5496a65579 Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/images/logo_small.png differ diff --git a/datacenter/dtr/2.2/reference/api/images/pet_store_api.png b/datacenter/dtr/2.2/reference/api/images/pet_store_api.png new file mode 100644 index 0000000000..f9f9cd4aeb Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/images/pet_store_api.png differ diff --git a/datacenter/dtr/2.2/reference/api/images/throbber.gif b/datacenter/dtr/2.2/reference/api/images/throbber.gif new file mode 100644 index 0000000000..0639388924 Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/images/throbber.gif differ diff --git a/datacenter/dtr/2.2/reference/api/images/wordnik_api.png b/datacenter/dtr/2.2/reference/api/images/wordnik_api.png new file mode 100644 index 0000000000..dca4f1455a Binary files /dev/null and b/datacenter/dtr/2.2/reference/api/images/wordnik_api.png differ diff --git a/datacenter/dtr/2.2/reference/api/index.html b/datacenter/dtr/2.2/reference/api/index.html new file mode 100644 index 0000000000..ddd268cefb --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/index.html @@ -0,0 +1,32 @@ + + + + + Docker Trusted Registry API Documentation + + + + + + + + + + + + + + + + + + + + + + + +
+ + + diff --git a/datacenter/dtr/2.2/reference/api/index.md b/datacenter/dtr/2.2/reference/api/index.md new file mode 100644 index 0000000000..c91eb48323 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/index.md @@ -0,0 +1,29 @@ +--- +description: Learn how to use the Docker Trusted Registry REST API +keywords: dtr, api, reference +title: Docker Trusted Registry 2.2 API +--- + +
+
+ + + + + + + + + + + + + + + + + + + + +
diff --git a/datacenter/dtr/2.2/reference/api/lang/en.js b/datacenter/dtr/2.2/reference/api/lang/en.js new file mode 100644 index 0000000000..776a8b72e0 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/lang/en.js @@ -0,0 +1,53 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Warning: Deprecated", + "Implementation Notes":"Implementation Notes", + "Response Class":"Response Class", + "Status":"Status", + "Parameters":"Parameters", + "Parameter":"Parameter", + "Value":"Value", + "Description":"Description", + "Parameter Type":"Parameter Type", + "Data Type":"Data Type", + "Response Messages":"Response Messages", + "HTTP Status Code":"HTTP Status Code", + "Reason":"Reason", + "Response Model":"Response Model", + "Request URL":"Request URL", + "Response Body":"Response Body", + "Response Code":"Response Code", + "Response Headers":"Response Headers", + "Hide Response":"Hide Response", + "Headers":"Headers", + "Try it out!":"Try it out!", + "Show/Hide":"Show/Hide", + "List Operations":"List Operations", + "Expand Operations":"Expand Operations", + "Raw":"Raw", + "can't parse JSON. Raw result":"can't parse JSON. Raw result", + "Model Schema":"Model Schema", + "Model":"Model", + "apply":"apply", + "Username":"Username", + "Password":"Password", + "Terms of service":"Terms of service", + "Created by":"Created by", + "See more at":"See more at", + "Contact the developer":"Contact the developer", + "api version":"api version", + "Response Content Type":"Response Content Type", + "fetching resource":"fetching resource", + "fetching resource list":"fetching resource list", + "Explore":"Explore", + "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Can't read from server. It may not have the appropriate access-control-origin settings.", + "Please specify the protocol for":"Please specify the protocol for", + "Can't read swagger JSON from":"Can't read swagger JSON from", + "Finished Loading Resource Information. Rendering Swagger UI":"Finished Loading Resource Information. Rendering Swagger UI", + "Unable to read api":"Unable to read api", + "from path":"from path", + "server returned":"server returned" +}); diff --git a/datacenter/dtr/2.2/reference/api/lang/es.js b/datacenter/dtr/2.2/reference/api/lang/es.js new file mode 100644 index 0000000000..a8dff60b6a --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/lang/es.js @@ -0,0 +1,52 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Advertencia: Obsoleto", + "Implementation Notes":"Notas de implementación", + "Response Class":"Clase de la Respuesta", + "Status":"Status", + "Parameters":"Parámetros", + "Parameter":"Parámetro", + "Value":"Valor", + "Description":"Descripción", + "Parameter Type":"Tipo del Parámetro", + "Data Type":"Tipo del Dato", + "Response Messages":"Mensajes de la Respuesta", + "HTTP Status Code":"Código de Status HTTP", + "Reason":"Razón", + "Response Model":"Modelo de la Respuesta", + "Request URL":"URL de la Solicitud", + "Response Body":"Cuerpo de la Respuesta", + "Response Code":"Código de la Respuesta", + "Response Headers":"Encabezados de la Respuesta", + "Hide Response":"Ocultar Respuesta", + "Try it out!":"Pruébalo!", + "Show/Hide":"Mostrar/Ocultar", + "List Operations":"Listar Operaciones", + "Expand Operations":"Expandir Operaciones", + "Raw":"Crudo", + "can't parse JSON. Raw result":"no puede parsear el JSON. Resultado crudo", + "Model Schema":"Esquema del Modelo", + "Model":"Modelo", + "apply":"aplicar", + "Username":"Nombre de usuario", + "Password":"Contraseña", + "Terms of service":"Términos de Servicio", + "Created by":"Creado por", + "See more at":"Ver más en", + "Contact the developer":"Contactar al desarrollador", + "api version":"versión de la api", + "Response Content Type":"Tipo de Contenido (Content Type) de la Respuesta", + "fetching resource":"buscando recurso", + "fetching resource list":"buscando lista del recurso", + "Explore":"Explorar", + "Show Swagger Petstore Example Apis":"Mostrar Api Ejemplo de Swagger Petstore", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"No se puede leer del servidor. Tal vez no tiene la configuración de control de acceso de origen (access-control-origin) apropiado.", + "Please specify the protocol for":"Por favor, especificar el protocola para", + "Can't read swagger JSON from":"No se puede leer el JSON de swagger desde", + "Finished Loading Resource Information. Rendering Swagger UI":"Finalizada la carga del recurso de Información. Mostrando Swagger UI", + "Unable to read api":"No se puede leer la api", + "from path":"desde ruta", + "server returned":"el servidor retornó" +}); diff --git a/datacenter/dtr/2.2/reference/api/lang/pt.js b/datacenter/dtr/2.2/reference/api/lang/pt.js new file mode 100644 index 0000000000..f2e7c13d41 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/lang/pt.js @@ -0,0 +1,53 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Aviso: Depreciado", + "Implementation Notes":"Notas de Implementação", + "Response Class":"Classe de resposta", + "Status":"Status", + "Parameters":"Parâmetros", + "Parameter":"Parâmetro", + "Value":"Valor", + "Description":"Descrição", + "Parameter Type":"Tipo de parâmetro", + "Data Type":"Tipo de dados", + "Response Messages":"Mensagens de resposta", + "HTTP Status Code":"Código de status HTTP", + "Reason":"Razão", + "Response Model":"Modelo resposta", + "Request URL":"URL requisição", + "Response Body":"Corpo da resposta", + "Response Code":"Código da resposta", + "Response Headers":"Cabeçalho da resposta", + "Headers":"Cabeçalhos", + "Hide Response":"Esconder resposta", + "Try it out!":"Tente agora!", + "Show/Hide":"Mostrar/Esconder", + "List Operations":"Listar operações", + "Expand Operations":"Expandir operações", + "Raw":"Cru", + "can't parse JSON. Raw result":"Falha ao analisar JSON. Resulto cru", + "Model Schema":"Modelo esquema", + "Model":"Modelo", + "apply":"Aplicar", + "Username":"Usuário", + "Password":"Senha", + "Terms of service":"Termos do serviço", + "Created by":"Criado por", + "See more at":"Veja mais em", + "Contact the developer":"Contate o desenvolvedor", + "api version":"Versão api", + "Response Content Type":"Tipo de conteúdo da resposta", + "fetching resource":"busca recurso", + "fetching resource list":"buscando lista de recursos", + "Explore":"Explorar", + "Show Swagger Petstore Example Apis":"Show Swagger Petstore Example Apis", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Não é possível ler do servidor. Pode não ter as apropriadas configurações access-control-origin", + "Please specify the protocol for":"Por favor especifique o protocolo", + "Can't read swagger JSON from":"Não é possível ler o JSON Swagger de", + "Finished Loading Resource Information. Rendering Swagger UI":"Carregar informação de recurso finalizada. Renderizando Swagger UI", + "Unable to read api":"Não foi possível ler api", + "from path":"do caminho", + "server returned":"servidor retornou" +}); diff --git a/datacenter/dtr/2.2/reference/api/lang/ru.js b/datacenter/dtr/2.2/reference/api/lang/ru.js new file mode 100644 index 0000000000..065100f73f --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/lang/ru.js @@ -0,0 +1,52 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Ворнинг: Депрекейтед", + "Implementation Notes":"Заметки", + "Response Class":"Пример ответа", + "Status":"Статус", + "Parameters":"Параметры", + "Parameter":"Параметр", + "Value":"Значение", + "Description":"Описание", + "Parameter Type":"Тип параметра", + "Data Type":"Тип данных", + "HTTP Status Code":"HTTP код", + "Reason":"Причина", + "Response Model":"Структура ответа", + "Request URL":"URL запроса", + "Response Body":"Тело ответа", + "Response Code":"HTTP код ответа", + "Response Headers":"Заголовки ответа", + "Hide Response":"Спрятать ответ", + "Response Messages":"Что может прийти в ответ", + "Try it out!":"Попробовать!", + "Show/Hide":"Показать/Скрыть", + "List Operations":"Операции кратко", + "Expand Operations":"Операции подробно", + "Raw":"В сыром виде", + "can't parse JSON. Raw result":"Не удается распарсить ответ:", + "Model Schema":"Структура", + "Model":"Описание", + "apply":"применить", + "Username":"Имя пользователя", + "Password":"Пароль", + "Terms of service":"Условия использования", + "Created by":"Разработано", + "See more at":"Еще тут", + "Contact the developer":"Связаться с разработчиком", + "api version":"Версия API", + "Response Content Type":"Content Type ответа", + "fetching resource":"Получение ресурса", + "fetching resource list":"Получение ресурсов", + "Explore":"Поехали", + "Show Swagger Petstore Example Apis":"Показать примеры АПИ", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Не удается получить ответ от сервера. Возможно, какая-то лажа с настройками доступа", + "Please specify the protocol for":"Пожалуйста, укажите протогол для", + "Can't read swagger JSON from":"Не получается прочитать swagger json из", + "Finished Loading Resource Information. Rendering Swagger UI":"Загрузка информации о ресурсах завершена. Рендерим", + "Unable to read api":"Не удалось прочитать api", + "from path":"по адресу", + "server returned":"сервер сказал" +}); diff --git a/datacenter/dtr/2.2/reference/api/lang/tr.js b/datacenter/dtr/2.2/reference/api/lang/tr.js new file mode 100644 index 0000000000..16426a9c34 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/lang/tr.js @@ -0,0 +1,53 @@ +'use strict'; + +/* jshint quotmark: double */ +window.SwaggerTranslator.learn({ + "Warning: Deprecated":"Uyarı: Deprecated", + "Implementation Notes":"Gerçekleştirim Notları", + "Response Class":"Dönen Sınıf", + "Status":"Statü", + "Parameters":"Parametreler", + "Parameter":"Parametre", + "Value":"Değer", + "Description":"Açıklama", + "Parameter Type":"Parametre Tipi", + "Data Type":"Veri Tipi", + "Response Messages":"Dönüş Mesajı", + "HTTP Status Code":"HTTP Statü Kodu", + "Reason":"Gerekçe", + "Response Model":"Dönüş Modeli", + "Request URL":"İstek URL", + "Response Body":"Dönüş İçeriği", + "Response Code":"Dönüş Kodu", + "Response Headers":"Dönüş Üst Bilgileri", + "Hide Response":"Dönüşü Gizle", + "Headers":"Üst Bilgiler", + "Try it out!":"Dene!", + "Show/Hide":"Göster/Gizle", + "List Operations":"Operasyonları Listele", + "Expand Operations":"Operasyonları Aç", + "Raw":"Ham", + "can't parse JSON. Raw result":"JSON çözümlenemiyor. Ham sonuç", + "Model Schema":"Model Şema", + "Model":"Model", + "apply":"uygula", + "Username":"Kullanıcı Adı", + "Password":"Parola", + "Terms of service":"Servis şartları", + "Created by":"Oluşturan", + "See more at":"Daha fazlası için", + "Contact the developer":"Geliştirici ile İletişime Geçin", + "api version":"api versiyon", + "Response Content Type":"Dönüş İçerik Tipi", + "fetching resource":"kaynak getiriliyor", + "fetching resource list":"kaynak listesi getiriliyor", + "Explore":"Keşfet", + "Show Swagger Petstore Example Apis":"Swagger Petstore Örnek Api'yi Gör", + "Can't read from server. It may not have the appropriate access-control-origin settings.":"Sunucudan okuma yapılamıyor. Sunucu access-control-origin ayarlarınızı kontrol edin.", + "Please specify the protocol for":"Lütfen istenen adres için protokol belirtiniz", + "Can't read swagger JSON from":"Swagger JSON bu kaynaktan okunamıyor", + "Finished Loading Resource Information. Rendering Swagger UI":"Kaynak baglantısı tamamlandı. Swagger UI gösterime hazırlanıyor", + "Unable to read api":"api okunamadı", + "from path":"yoldan", + "server returned":"sunucuya dönüldü" +}); diff --git a/datacenter/dtr/2.2/reference/api/lang/translator.js b/datacenter/dtr/2.2/reference/api/lang/translator.js new file mode 100644 index 0000000000..591f6d4094 --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/lang/translator.js @@ -0,0 +1,39 @@ +'use strict'; + +/** + * Translator for documentation pages. + * + * To enable translation you should include one of language-files in your index.html + * after . + * For example - + * + * If you wish to translate some new texsts you should do two things: + * 1. Add a new phrase pair ("New Phrase": "New Translation") into your language file (for example lang/ru.js). It will be great if you add it in other language files too. + * 2. Mark that text it templates this way New Phrase or . + * The main thing here is attribute data-sw-translate. Only inner html, title-attribute and value-attribute are going to translate. + * + */ +window.SwaggerTranslator = { + + _words:[], + + translate: function(sel) { + var $this = this; + sel = sel || '[data-sw-translate]'; + + $(sel).each(function() { + $(this).html($this._tryTranslate($(this).html())); + + $(this).val($this._tryTranslate($(this).val())); + $(this).attr('title', $this._tryTranslate($(this).attr('title'))); + }); + }, + + _tryTranslate: function(word) { + return this._words[$.trim(word)] !== undefined ? this._words[$.trim(word)] : word; + }, + + learn: function(wordsMap) { + this._words = wordsMap; + } +}; diff --git a/datacenter/dtr/2.2/reference/api/lib/backbone-min.js b/datacenter/dtr/2.2/reference/api/lib/backbone-min.js new file mode 100644 index 0000000000..a3f544be6d --- /dev/null +++ b/datacenter/dtr/2.2/reference/api/lib/backbone-min.js @@ -0,0 +1,15 @@ +// Backbone.js 1.1.2 + +(function(t,e){if(typeof define==="function"&&define.amd){define(["underscore","jquery","exports"],function(i,r,s){t.Backbone=e(t,s,i,r)})}else if(typeof exports!=="undefined"){var i=require("underscore");e(t,exports,i)}else{t.Backbone=e(t,{},t._,t.jQuery||t.Zepto||t.ender||t.$)}})(this,function(t,e,i,r){var s=t.Backbone;var n=[];var a=n.push;var o=n.slice;var h=n.splice;e.VERSION="1.1.2";e.$=r;e.noConflict=function(){t.Backbone=s;return this};e.emulateHTTP=false;e.emulateJSON=false;var u=e.Events={on:function(t,e,i){if(!c(this,"on",t,[e,i])||!e)return this;this._events||(this._events={});var r=this._events[t]||(this._events[t]=[]);r.push({callback:e,context:i,ctx:i||this});return this},once:function(t,e,r){if(!c(this,"once",t,[e,r])||!e)return this;var s=this;var n=i.once(function(){s.off(t,n);e.apply(this,arguments)});n._callback=e;return this.on(t,n,r)},off:function(t,e,r){var s,n,a,o,h,u,l,f;if(!this._events||!c(this,"off",t,[e,r]))return this;if(!t&&!e&&!r){this._events=void 0;return this}o=t?[t]:i.keys(this._events);for(h=0,u=o.length;h").attr(t);this.setElement(r,false)}else{this.setElement(i.result(this,"el"),false)}}});e.sync=function(t,r,s){var n=T[t];i.defaults(s||(s={}),{emulateHTTP:e.emulateHTTP,emulateJSON:e.emulateJSON});var a={type:n,dataType:"json"};if(!s.url){a.url=i.result(r,"url")||M()}if(s.data==null&&r&&(t==="create"||t==="update"||t==="patch")){a.contentType="application/json";a.data=JSON.stringify(s.attrs||r.toJSON(s))}if(s.emulateJSON){a.contentType="application/x-www-form-urlencoded";a.data=a.data?{model:a.data}:{}}if(s.emulateHTTP&&(n==="PUT"||n==="DELETE"||n==="PATCH")){a.type="POST";if(s.emulateJSON)a.data._method=n;var o=s.beforeSend;s.beforeSend=function(t){t.setRequestHeader("X-HTTP-Method-Override",n);if(o)return o.apply(this,arguments)}}if(a.type!=="GET"&&!s.emulateJSON){a.processData=false}if(a.type==="PATCH"&&k){a.xhr=function(){return new ActiveXObject("Microsoft.XMLHTTP")}}var h=s.xhr=e.ajax(i.extend(a,s));r.trigger("request",r,h,s);return h};var k=typeof window!=="undefined"&&!!window.ActiveXObject&&!(window.XMLHttpRequest&&(new XMLHttpRequest).dispatchEvent);var T={create:"POST",update:"PUT",patch:"PATCH","delete":"DELETE",read:"GET"};e.ajax=function(){return e.$.ajax.apply(e.$,arguments)};var $=e.Router=function(t){t||(t={});if(t.routes)this.routes=t.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var S=/\((.*?)\)/g;var H=/(\(\?)?:\w+/g;var A=/\*\w+/g;var I=/[\-{}\[\]+?.,\\\^$|#\s]/g;i.extend($.prototype,u,{initialize:function(){},route:function(t,r,s){if(!i.isRegExp(t))t=this._routeToRegExp(t);if(i.isFunction(r)){s=r;r=""}if(!s)s=this[r];var n=this;e.history.route(t,function(i){var a=n._extractParameters(t,i);n.execute(s,a);n.trigger.apply(n,["route:"+r].concat(a));n.trigger("route",r,a);e.history.trigger("route",n,r,a)});return this},execute:function(t,e){if(t)t.apply(this,e)},navigate:function(t,i){e.history.navigate(t,i);return this},_bindRoutes:function(){if(!this.routes)return;this.routes=i.result(this,"routes");var t,e=i.keys(this.routes);while((t=e.pop())!=null){this.route(t,this.routes[t])}},_routeToRegExp:function(t){t=t.replace(I,"\\$&").replace(S,"(?:$1)?").replace(H,function(t,e){return e?t:"([^/?]+)"}).replace(A,"([^?]*?)");return new RegExp("^"+t+"(?:\\?([\\s\\S]*))?$")},_extractParameters:function(t,e){var r=t.exec(e).slice(1);return i.map(r,function(t,e){if(e===r.length-1)return t||null;return t?decodeURIComponent(t):null})}});var N=e.History=function(){this.handlers=[];i.bindAll(this,"checkUrl");if(typeof window!=="undefined"){this.location=window.location;this.history=window.history}};var R=/^[#\/]|\s+$/g;var O=/^\/+|\/+$/g;var P=/msie [\w.]+/;var C=/\/$/;var j=/#.*$/;N.started=false;i.extend(N.prototype,u,{interval:50,atRoot:function(){return this.location.pathname.replace(/[^\/]$/,"$&/")===this.root},getHash:function(t){var e=(t||this).location.href.match(/#(.*)$/);return e?e[1]:""},getFragment:function(t,e){if(t==null){if(this._hasPushState||!this._wantsHashChange||e){t=decodeURI(this.location.pathname+this.location.search);var i=this.root.replace(C,"");if(!t.indexOf(i))t=t.slice(i.length)}else{t=this.getHash()}}return t.replace(R,"")},start:function(t){if(N.started)throw new Error("Backbone.history has already been started");N.started=true;this.options=i.extend({root:"/"},this.options,t);this.root=this.options.root;this._wantsHashChange=this.options.hashChange!==false;this._wantsPushState=!!this.options.pushState;this._hasPushState=!!(this.options.pushState&&this.history&&this.history.pushState);var r=this.getFragment();var s=document.documentMode;var n=P.exec(navigator.userAgent.toLowerCase())&&(!s||s<=7);this.root=("/"+this.root+"/").replace(O,"/");if(n&&this._wantsHashChange){var a=e.$('