diff --git a/engine/admin/ambassador_pattern_linking.md b/engine/admin/ambassador_pattern_linking.md index 5d4ea90e5a4..7622d2796a3 100644 --- a/engine/admin/ambassador_pattern_linking.md +++ b/engine/admin/ambassador_pattern_linking.md @@ -1,16 +1,14 @@ ---- -aliases: -- /engine/articles/ambassador_pattern_linking/ -description: Using the Ambassador pattern to abstract (network) services -keywords: -- Examples, Usage, links, docker, documentation, examples, names, name, container - naming -menu: - main: - parent: engine_admin - weight: 15 -title: Link via an ambassador container ---- + # Link via an ambassador container diff --git a/engine/admin/b2d_volume_resize.md b/engine/admin/b2d_volume_resize.md index 1491555f417..347d1d48467 100644 --- a/engine/admin/b2d_volume_resize.md +++ b/engine/admin/b2d_volume_resize.md @@ -1,15 +1,15 @@ ---- -description: Resizing a Boot2Docker volume in VirtualBox with GParted -draft: "true" -keywords: -- boot2docker, volume, virtualbox -menu: - main: - parent: smn_win_osx -title: "Resizing a Boot2Docker volume\t" ---- - -# Getting “no space left on device” errors with Boot2Docker? + + +# Getting "no space left on device" errors with Boot2Docker? If you're using Boot2Docker with a large number of images, or the images you're working with are very large, your pulls might start failing with "no space left diff --git a/engine/admin/chef.md b/engine/admin/chef.md index 0b9fd985b10..523e71782dc 100644 --- a/engine/admin/chef.md +++ b/engine/admin/chef.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/articles/chef/ -description: Installation and using Docker via Chef -keywords: -- chef, installation, usage, docker, documentation -menu: - main: - parent: engine_admin - weight: "11" -title: Using Chef ---- + # Using Chef diff --git a/engine/admin/dsc.md b/engine/admin/dsc.md index 75e404a808e..12002114476 100644 --- a/engine/admin/dsc.md +++ b/engine/admin/dsc.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/articles/dsc/ -description: Using DSC to configure a new Docker host -keywords: -- powershell, dsc, installation, usage, docker, documentation -menu: - main: - parent: engine_admin - weight: "10" -title: PowerShell DSC Usage ---- + # Using PowerShell DSC diff --git a/engine/admin/formatting.md b/engine/admin/formatting.md index 58bf0a092a2..08a70ab32c3 100644 --- a/engine/admin/formatting.md +++ b/engine/admin/formatting.md @@ -1,13 +1,13 @@ ---- -description: CLI and log output formatting reference -keywords: -- format, formatting, output, templates, log -menu: - main: - parent: engine_admin - weight: 7 -title: Format command and log output ---- + # Formatting reference @@ -20,6 +20,7 @@ list of elements they support in their templates: - [Docker Log Tag formatting](logging/log_tags.md) - [Docker Network Inspect formatting](../reference/commandline/network_inspect.md) - [Docker PS formatting](../reference/commandline/ps.md#formatting) +- [Docker Stats formatting](../reference/commandline/stats.md#formatting) - [Docker Volume Inspect formatting](../reference/commandline/volume_inspect.md) - [Docker Version formatting](../reference/commandline/version.md#examples) @@ -33,46 +34,34 @@ This is the complete list of the available functions with examples: Join concatenates a list of strings to create a single string. It puts a separator between each element in the list. - {% raw %} $ docker ps --format '{{join .Names " or "}}' - {% endraw %} ### Json Json encodes an element as a json string. - {% raw %} $ docker inspect --format '{{json .Mounts}}' container - {% endraw %} ### Lower Lower turns a string into its lower case representation. - {% raw %} $ docker inspect --format "{{lower .Name}}" container - {% endraw %} ### Split Split slices a string into a list of strings separated by a separator. - {% raw %} # docker inspect --format '{{split (join .Names "/") "/"}}' container - {% endraw %} ### Title Title capitalizes a string. - {% raw %} $ docker inspect --format "{{title .Name}}" container - {% endraw %} ### Upper -Upper turns a string into its upper case representation. +Upper turms a string into its upper case representation. - {% raw %} $ docker inspect --format "{{upper .Name}}" container - {% endraw %} diff --git a/engine/admin/host_integration.md b/engine/admin/host_integration.md index ecf69ea4dd0..179aeed73ad 100644 --- a/engine/admin/host_integration.md +++ b/engine/admin/host_integration.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/articles/host_integration/ -description: How to generate scripts for upstart, systemd, etc. -keywords: -- systemd, upstart, supervisor, docker, documentation, host integration -menu: - main: - parent: engine_admin - weight: "5" -title: Automatically start containers ---- + # Automatically start containers diff --git a/engine/admin/index.md b/engine/admin/index.md index ef66f33278c..e65807f9cf5 100644 --- a/engine/admin/index.md +++ b/engine/admin/index.md @@ -1,16 +1,17 @@ ---- -aliases: -- /engine/articles/configuring/ -- /engine/admin/configuring/ -description: Configuring and running the Docker daemon on various distributions -keywords: -- docker, daemon, configuration, running, process managers -menu: - main: - parent: engine_admin - weight: 0 -title: Configuring and running Docker ---- + # Configuring and running Docker on various distributions diff --git a/engine/admin/live-restore.md b/engine/admin/live-restore.md index ee1f7f470a5..23792b66725 100644 --- a/engine/admin/live-restore.md +++ b/engine/admin/live-restore.md @@ -1,13 +1,13 @@ ---- -description: How to keep containers running when the daemon isn't available. -keywords: -- docker, upgrade, daemon, dockerd, live-restore, daemonless container -menu: - main: - parent: engine_admin - weight: "6" -title: Keep containers alive during daemon downtime ---- + # Keep containers alive during daemon downtime diff --git a/engine/admin/logging/awslogs.md b/engine/admin/logging/awslogs.md index ff8e8316913..fce53aee6b8 100644 --- a/engine/admin/logging/awslogs.md +++ b/engine/admin/logging/awslogs.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/reference/logging/awslogs/ -description: Describes how to use the Amazon CloudWatch Logs logging driver. -keywords: -- AWS, Amazon, CloudWatch, logging, driver -menu: - main: - parent: smn_logging -title: Amazon CloudWatch Logs logging driver ---- + # Amazon CloudWatch Logs logging driver diff --git a/engine/admin/logging/etwlogs.md b/engine/admin/logging/etwlogs.md index ec4eb832824..17fb65ae515 100644 --- a/engine/admin/logging/etwlogs.md +++ b/engine/admin/logging/etwlogs.md @@ -1,12 +1,13 @@ ---- -description: Describes how to use the etwlogs logging driver. -keywords: -- ETW, docker, logging, driver -menu: - main: - parent: smn_logging -title: ETW logging driver ---- + + # ETW logging driver diff --git a/engine/admin/logging/fluentd.md b/engine/admin/logging/fluentd.md index abc9cc639e5..575fb0efe4e 100644 --- a/engine/admin/logging/fluentd.md +++ b/engine/admin/logging/fluentd.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/reference/logging/fluentd/ -description: Describes how to use the fluentd logging driver. -keywords: -- Fluentd, docker, logging, driver -menu: - main: - parent: smn_logging -title: Fluentd logging driver ---- + # Fluentd logging driver @@ -33,10 +32,8 @@ The `docker logs` command is not available for this logging driver. Some options are supported by specifying `--log-opt` as many times as needed: - {% raw %} - `fluentd-address`: specify `host:port` to connect `localhost:24224` - `tag`: specify tag for fluentd message, which interpret some markup, ex `{{.ID}}`, `{{.FullID}}` or `{{.Name}}` `docker.{{.ID}}` - {% endraw %} Configure the default logging driver by passing the diff --git a/engine/admin/logging/gcplogs.md b/engine/admin/logging/gcplogs.md index 04687fef248..e52513c416f 100644 --- a/engine/admin/logging/gcplogs.md +++ b/engine/admin/logging/gcplogs.md @@ -1,12 +1,12 @@ ---- -description: Describes how to use the Google Cloud Logging driver. -keywords: -- gcplogs, google, docker, logging, driver -menu: - main: - parent: smn_logging -title: Google Cloud Logging driver ---- + # Google Cloud Logging driver @@ -37,6 +37,10 @@ The `--gcp-project` takes precedence over information discovered from the metada so a Docker daemon running in a Google Cloud Project can be overridden to log to a different Google Cloud Project using `--gcp-project`. +Docker fetches the values for zone, instance name and instance id from Google +Cloud metadata server. Those values can be provided via options if metadata +server is not available. They will not override the values from metadata server. + ## gcplogs options You can use the `--log-opt NAME=VALUE` flag to specify these additional Google @@ -48,6 +52,9 @@ Cloud Logging driver options: | `gcp-log-cmd` | optional | Whether to log the command that the container was started with. Defaults to false. | | `labels` | optional | Comma-separated list of keys of labels, which should be included in message, if these labels are specified for container. | | `env` | optional | Comma-separated list of keys of environment variables, which should be included in message, if these variables are specified for container. | +| `gcp-meta-zone` | optional | Zone name for the instance. | +| `gcp-meta-name` | optional | Instance name. | +| `gcp-meta-id` | optional | Instance ID. | If there is collision between `label` and `env` keys, the value of the `env` takes precedence. Both options add additional fields to the attributes of a @@ -57,13 +64,22 @@ Below is an example of the logging options required to log to the default logging destination which is discovered by querying the GCE metadata server. docker run --log-driver=gcplogs \ - --log-opt labels=location - --log-opt env=TEST - --log-opt gcp-log-cmd=true - --env "TEST=false" - --label location=west + --log-opt labels=location \ + --log-opt env=TEST \ + --log-opt gcp-log-cmd=true \ + --env "TEST=false" \ + --label location=west \ your/application This configuration also directs the driver to include in the payload the label `location`, the environment variable `ENV`, and the command used to start the container. + +An example of the logging options for running outside of GCE (the daemon must be +configured with GOOGLE_APPLICATION_CREDENTIALS): + + docker run --log-driver=gcplogs \ + --log-opt gcp-project=test-project + --log-opt gcp-meta-zone=west1 \ + --log-opt gcp-meta-name=`hostname` \ + your/application diff --git a/engine/admin/logging/index.md b/engine/admin/logging/index.md index 7bf4873c15a..c01d4552ad4 100644 --- a/engine/admin/logging/index.md +++ b/engine/admin/logging/index.md @@ -1,16 +1,16 @@ ---- -aliases: -- /engine/reference/logging/ -description: Logging and Logging Drivers -keywords: -- ' docker, logging, driver' -menu: - main: - identifier: smn_logging - parent: engine_admin - weight: 9 -title: Logging ---- + + # Logging Drivers diff --git a/engine/admin/logging/journald.md b/engine/admin/logging/journald.md index 22479dd4974..d4991cfb596 100644 --- a/engine/admin/logging/journald.md +++ b/engine/admin/logging/journald.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/reference/logging/journald/ -description: Describes how to use the fluentd logging driver. -keywords: -- Journald, docker, logging, driver -menu: - main: - parent: smn_logging -title: Journald logging driver ---- + # Journald logging driver diff --git a/engine/admin/logging/log_tags.md b/engine/admin/logging/log_tags.md index a11a6c3678c..357caf184e0 100644 --- a/engine/admin/logging/log_tags.md +++ b/engine/admin/logging/log_tags.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/reference/logging/log_tags/ -description: Describes how to format tags for. -keywords: -- docker, logging, driver, syslog, Fluentd, gelf, journald -menu: - main: - parent: smn_logging - weight: -1 -title: Log tags for logging driver ---- + # Log Tags @@ -23,7 +22,6 @@ docker run --log-driver=fluentd --log-opt fluentd-address=myhost.local:24224 --l Docker supports some special template markup you can use when specifying a tag's value: -{% raw %} | Markup | Description | |--------------------|------------------------------------------------------| | `{{.ID}}` | The first 12 characters of the container id. | @@ -35,18 +33,15 @@ Docker supports some special template markup you can use when specifying a tag's | `{{.DaemonName}}` | The name of the docker program (`docker`). | For example, specifying a `--log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}"` value yields `syslog` log lines like: -{% endraw %} ``` Aug 7 18:33:19 HOSTNAME docker/hello-world/foobar/5790672ab6a0[9103]: Hello from Docker. ``` -{% raw %} At startup time, the system sets the `container_name` field and `{{.Name}}` in the tags. If you use `docker rename` to rename a container, the new name is not reflected in the log messages. Instead, these messages continue to use the original container name. -{% endraw %} For advanced usage, the generated tag's use [go templates](http://golang.org/pkg/text/template/) and the container's [logging @@ -54,14 +49,14 @@ context](https://github.com/docker/docker/blob/master/daemon/logger/context.go). As an example of what is possible with the syslog logger: -```{% raw %} +``` $ docker run -it --rm \ --log-driver syslog \ --log-opt tag="{{ (.ExtraAttributes nil).SOME_ENV_VAR }}" \ --log-opt env=SOME_ENV_VAR \ -e SOME_ENV_VAR=logtester.1234 \ flyinprogrammer/logtester -{% endraw %}``` +``` Results in logs like this: diff --git a/engine/admin/logging/overview.md b/engine/admin/logging/overview.md index 17e1ec7b4dd..4688709b999 100644 --- a/engine/admin/logging/overview.md +++ b/engine/admin/logging/overview.md @@ -1,15 +1,15 @@ ---- -aliases: -- /engine/reference/logging/overview/ -description: Configure logging driver. -keywords: -- docker, logging, driver, Fluentd -menu: - main: - parent: smn_logging - weight: -99 -title: Configuring Logging Drivers ---- + + # Configure logging drivers @@ -225,7 +225,7 @@ compresses each log message. The accepted values are `gzip`, `zlib` and `none`. `gzip` is chosen by default. The `gelf-compression-level` option can be used to change the level of -compression when `gzip` or `zlib` is selected as `gelf-compression-type`. +compresssion when `gzip` or `zlib` is selected as `gelf-compression-type`. Accepted value must be from from -1 to 9 (BestCompression). Higher levels typically run slower but compress more. Default value is 1 (BestSpeed). @@ -243,13 +243,13 @@ logging driver options. For example, to specify both additional options: -```bash{% raw %} +```bash $ docker run -dit \ --log-driver=fluentd \ --log-opt fluentd-address=localhost:24224 \ --log-opt tag="docker.{{.Name}}" \ alpine sh -{% endraw %}``` +``` If container cannot connect to the Fluentd daemon on the specified address and `fluentd-async-connect` is not enabled, the container stops immediately. diff --git a/engine/admin/logging/splunk.md b/engine/admin/logging/splunk.md index 2db55e0f880..e081512d2c2 100644 --- a/engine/admin/logging/splunk.md +++ b/engine/admin/logging/splunk.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/reference/logging/splunk/ -description: Describes how to use the Splunk logging driver. -keywords: -- splunk, docker, logging, driver -menu: - main: - parent: smn_logging -title: Splunk logging driver ---- + # Splunk logging driver @@ -33,21 +32,23 @@ You can set the logging driver for a specific container by using the You can use the `--log-opt NAME=VALUE` flag to specify these additional Splunk logging driver options: -{% raw %} -| Option | Required | Description | -|-----------------------------|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| `splunk-token` | required | Splunk HTTP Event Collector token. | -| `splunk-url` | required | Path to your Splunk Enterprise or Splunk Cloud instance (including port and scheme used by HTTP Event Collector) `https://your_splunk_instance:8088`. | -| `splunk-source` | optional | Event source. | -| `splunk-sourcetype` | optional | Event source type. | -| `splunk-index` | optional | Event index. | -| `splunk-capath` | optional | Path to root certificate. | -| `splunk-caname` | optional | Name to use for validating server certificate; by default the hostname of the `splunk-url` will be used. | -| `splunk-insecureskipverify` | optional | Ignore server certificate validation. | -| `tag` | optional | Specify tag for message, which interpret some markup. Default value is `{{.ID}}` (12 characters of the container ID). Refer to the [log tag option documentation](log_tags.md) for customizing the log tag format. | -| `labels` | optional | Comma-separated list of keys of labels, which should be included in message, if these labels are specified for container. | -| `env` | optional | Comma-separated list of keys of environment variables, which should be included in message, if these variables are specified for container. | -{% endraw %} +| Option | Required | Description | +|-----------------------------|----------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| `splunk-token` | required | Splunk HTTP Event Collector token. | +| `splunk-url` | required | Path to your Splunk Enterprise or Splunk Cloud instance (including port and scheme used by HTTP Event Collector) `https://your_splunk_instance:8088`. | +| `splunk-source` | optional | Event source. | +| `splunk-sourcetype` | optional | Event source type. | +| `splunk-index` | optional | Event index. | +| `splunk-capath` | optional | Path to root certificate. | +| `splunk-caname` | optional | Name to use for validating server certificate; by default the hostname of the `splunk-url` will be used. | +| `splunk-insecureskipverify` | optional | Ignore server certificate validation. | +| `splunk-format` | optional | Message format. Can be `inline`, `json` or `raw`. Defaults to `inline`. | +| `splunk-verify-connection` | optional | Verify on start, that docker can connect to Splunk server. Defaults to true. | +| `splunk-gzip` | optional | Enable/disable gzip compression to send events to Splunk Enterprise or Splunk Cloud instance. Defaults to false. | +| `splunk-gzip-level` | optional | Set compression level for gzip. Valid values are -1 (default), 0 (no compression), 1 (best speed) ... 9 (best compression). Defaults to [DefaultCompression](https://golang.org/pkg/compress/gzip/#DefaultCompression). | +| `tag` | optional | Specify tag for message, which interpret some markup. Default value is `{{.ID}}` (12 characters of the container ID). Refer to the [log tag option documentation](log_tags.md) for customizing the log tag format. | +| `labels` | optional | Comma-separated list of keys of labels, which should be included in message, if these labels are specified for container. | +| `env` | optional | Comma-separated list of keys of environment variables, which should be included in message, if these variables are specified for container. | If there is collision between `label` and `env` keys, the value of the `env` takes precedence. Both options add additional fields to the attributes of a logging message. @@ -58,7 +59,6 @@ Docker daemon is running. The path to the root certificate and Common Name is specified using an HTTPS scheme. This is used for verification. The `SplunkServerDefaultCert` is automatically generated by Splunk certificates. - {% raw %} docker run --log-driver=splunk \ --log-opt splunk-token=176FCEBF-4CF5-4EDF-91BC-703796522D20 \ --log-opt splunk-url=https://splunkhost:8088 \ @@ -70,4 +70,78 @@ The `SplunkServerDefaultCert` is automatically generated by Splunk certificates. --env "TEST=false" --label location=west your/application - {% endraw %} + +### Message formats + +By default Logging Driver sends messages as `inline` format, where each message +will be embedded as a string, for example + +``` +{ + "attrs": { + "env1": "val1", + "label1": "label1" + }, + "tag": "MyImage/MyContainer", + "source": "stdout", + "line": "my message" +} +{ + "attrs": { + "env1": "val1", + "label1": "label1" + }, + "tag": "MyImage/MyContainer", + "source": "stdout", + "line": "{\"foo\": \"bar\"}" +} +``` + +In case if your messages are JSON objects you may want to embed them in the +message we send to Splunk. By specifying `--log-opt splunk-format=json` driver +will try to parse every line as a JSON object and send it as embedded object. In +case if it cannot parse it - message will be send as `inline`. For example + + +``` +{ + "attrs": { + "env1": "val1", + "label1": "label1" + }, + "tag": "MyImage/MyContainer", + "source": "stdout", + "line": "my message" +} +{ + "attrs": { + "env1": "val1", + "label1": "label1" + }, + "tag": "MyImage/MyContainer", + "source": "stdout", + "line": { + "foo": "bar" + } +} +``` + +Third format is a `raw` message. You can specify it by using +`--log-opt splunk-format=raw`. Attributes (environment variables and labels) and +tag will be prefixed to the message. For example + +``` +MyImage/MyContainer env1=val1 label1=label1 my message +MyImage/MyContainer env1=val1 label1=label1 {"foo": "bar"} +``` + +## Advanced options + +Splunk Logging Driver allows you to configure few advanced options by specifying next environment variables for the Docker daemon. + +| Environment variable name | Default value | Description | +|--------------------------------------------------|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------| +| `SPLUNK_LOGGING_DRIVER_POST_MESSAGES_FREQUENCY` | `5s` | If there is nothing to batch how often driver will post messages. You can think about this as the maximum time to wait for more messages to batch. | +| `SPLUNK_LOGGING_DRIVER_POST_MESSAGES_BATCH_SIZE` | `1000` | How many messages driver should wait before sending them in one batch. | +| `SPLUNK_LOGGING_DRIVER_BUFFER_MAX` | `10 * 1000` | If driver cannot connect to remote server, what is the maximum amount of messages it can hold in buffer for retries. | +| `SPLUNK_LOGGING_DRIVER_CHANNEL_SIZE` | `4 * 1000` | How many pending messages can be in the channel which is used to send messages to background logger worker, which batches them. | diff --git a/engine/admin/menu.md b/engine/admin/menu.md index cd338ca06ae..103b67b7e76 100644 --- a/engine/admin/menu.md +++ b/engine/admin/menu.md @@ -1,15 +1,15 @@ ---- -description: Administer Docker -keywords: -- Administer -menu: - main: - identifier: engine_admin - parent: engine_use - weight: "-70" -title: Admin Guide -type: menu ---- + # Admin Topics diff --git a/engine/admin/puppet.md b/engine/admin/puppet.md index 671a416d7de..dba779b4d80 100644 --- a/engine/admin/puppet.md +++ b/engine/admin/puppet.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/articles/puppet/ -description: Installing and using Puppet -keywords: -- puppet, installation, usage, docker, documentation -menu: - main: - parent: engine_admin - weight: "12" -title: Using Puppet ---- + # Using Puppet diff --git a/engine/admin/registry_mirror.md b/engine/admin/registry_mirror.md index 0aa3f755206..2d67f9c5cdf 100644 --- a/engine/admin/registry_mirror.md +++ b/engine/admin/registry_mirror.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/articles/registry_mirror/ -description: How to set up and run a local registry mirror -keywords: -- docker, registry, mirror, examples -menu: - main: - parent: engine_admin - weight: 8 -title: Run a local registry mirror ---- + # Run a local registry mirror diff --git a/engine/admin/runmetrics.md b/engine/admin/runmetrics.md index e2e98567270..1fdd745bedd 100644 --- a/engine/admin/runmetrics.md +++ b/engine/admin/runmetrics.md @@ -1,16 +1,14 @@ ---- -aliases: -- /engine/articles/run_metrics -- /engine/articles/runmetrics -description: Measure the behavior of running containers -keywords: -- docker, metrics, CPU, memory, disk, IO, run, runtime, stats -menu: - main: - parent: engine_admin - weight: 14 -title: Runtime metrics ---- + # Runtime metrics @@ -67,8 +65,8 @@ known to the system, the hierarchy they belong to, and how many groups they cont You can also look at `/proc//cgroup` to see which control groups a process belongs to. The control group will be shown as a path relative to the root of -the hierarchy mountpoint; e.g., `/` means “this process has not been assigned into -a particular group”, while `/lxc/pumpkin` means that the process is likely to be +the hierarchy mountpoint; e.g., `/` means "this process has not been assigned into +a particular group", while `/lxc/pumpkin` means that the process is likely to be a member of a container named `pumpkin`. ## Finding the cgroup for a given container @@ -281,7 +279,7 @@ program (present in the host system) within any network namespace visible to the current process. This means that your host will be able to enter the network namespace of your containers, but your containers won't be able to access the host, nor their sibling containers. -Containers will be able to “see” and affect their sub-containers, +Containers will be able to "see" and affect their sub-containers, though. The exact format of the command is: @@ -315,7 +313,7 @@ container, we need to: - Create a symlink from `/var/run/netns/` to `/proc//ns/net` - Execute `ip netns exec ....` -Please review [Enumerating Cgroups](runmetrics.md#enumerating-cgroups) to learn how to find +Please review [Enumerating Cgroups](#enumerating-cgroups) to learn how to find the cgroup of a process running in the container of which you want to measure network usage. From there, you can examine the pseudo-file named `tasks`, which contains the PIDs that are in the diff --git a/engine/admin/systemd.md b/engine/admin/systemd.md index 6e1289d9ca0..5dd9ec48220 100644 --- a/engine/admin/systemd.md +++ b/engine/admin/systemd.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/articles/systemd/ -description: Controlling and configuring Docker using systemd -keywords: -- docker, daemon, systemd, configuration -menu: - main: - parent: engine_admin - weight: "7" -title: Control and configure Docker with systemd ---- + # Control and configure Docker with systemd @@ -73,7 +72,7 @@ Alternatively, find out where the service file is located: EnvironmentFile=-/etc/sysconfig/docker You can customize the Docker daemon options using override files as explained in the -[HTTP Proxy example](systemd.md#http-proxy) below. The files located in `/usr/lib/systemd/system` +[HTTP Proxy example](#http-proxy) below. The files located in `/usr/lib/systemd/system` or `/lib/systemd/system` contain the default options and should not be edited. ### Runtime directory and storage driver diff --git a/engine/admin/using_supervisord.md b/engine/admin/using_supervisord.md index 2b221de1415..503bfeaee5b 100644 --- a/engine/admin/using_supervisord.md +++ b/engine/admin/using_supervisord.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/articles/using_supervisord/ -description: How to use Supervisor process management with Docker -keywords: -- docker, supervisor, process management -menu: - main: - parent: engine_admin - weight: "13" -title: Using Supervisor with Docker ---- + # Using Supervisor with Docker diff --git a/engine/breaking_changes.md b/engine/breaking_changes.md index 266778ea7c7..ac3a8630571 100644 --- a/engine/breaking_changes.md +++ b/engine/breaking_changes.md @@ -1,16 +1,15 @@ ---- -aliases: -- /engine/misc/breaking/ -description: Breaking changes -keywords: -- docker, documentation, about, technology, breaking -- incompatibilities -menu: - main: - parent: engine_use - weight: 80 -title: Breaking changes ---- + # Breaking changes and incompatibilities diff --git a/engine/deprecated.md b/engine/deprecated.md index fcbba872895..e7a301aa271 100644 --- a/engine/deprecated.md +++ b/engine/deprecated.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/misc/deprecated/ -description: Deprecated Features. -keywords: -- docker, documentation, about, technology, deprecate -menu: - main: - parent: engine_use - weight: 80 -title: Deprecated Engine Features ---- + # Deprecated Engine Features @@ -18,6 +17,13 @@ To learn more about Docker Engine's deprecation policy, see [Feature Deprecation Policy](index.md#feature-deprecation-policy). +### `docker daemon` subcommand +**Deprecated In Release: [v1.13](https://github.com/docker/docker/releases/)** + +**Target For Removal In Release: v1.16** + +The daemon is moved to a separate binary (`dockerd`), and should be used instead. + ### Three argument form in `docker import` **Deprecated In Release: [v0.6.7](https://github.com/docker/docker/releases/tag/v0.6.7)** @@ -106,9 +112,7 @@ Log tags are now generated in a standard way across different logging drivers. Because of which, the driver specific log tag options `syslog-tag`, `gelf-tag` and `fluentd-tag` have been deprecated in favor of the generic `tag` option. - {% raw %} docker --log-driver=syslog --log-opt tag="{{.ImageName}}/{{.Name}}/{{.ID}}" - {% endraw %} ### LXC built-in exec driver **Deprecated In Release: [v1.8.0](https://github.com/docker/docker/releases/tag/v1.8.0)** @@ -175,6 +179,15 @@ The single-dash (`-help`) was removed, in favor of the double-dash `--help` docker -help docker [COMMAND] -help +### `--run` flag on docker commit + +**Deprecated In Release: [v0.10.0](https://github.com/docker/docker/releases/tag/v0.10.0)** + +**Removed In Release: [v1.13.0](https://github.com/docker/docker/releases/)** + +The flag `--run` of the docker commit (and its short version `-run`) were deprecated in favor +of the `--changes` flag that allows to pass `Dockerfile` commands. + ### Interacting with V1 registries @@ -189,3 +202,8 @@ Since 1.9, Docker Content Trust Offline key has been renamed to Root key and the - DOCKER_CONTENT_TRUST_OFFLINE_PASSPHRASE is now named DOCKER_CONTENT_TRUST_ROOT_PASSPHRASE - DOCKER_CONTENT_TRUST_TAGGING_PASSPHRASE is now named DOCKER_CONTENT_TRUST_REPOSITORY_PASSPHRASE + +### `MAINTAINER` in Dockerfile +**Deprecated In Release: v1.13.0** + +`MAINTAINER` was an early very limited form of `LABEL` which should be used instead. diff --git a/engine/examples/apt-cacher-ng.md b/engine/examples/apt-cacher-ng.md index 55ab43cba09..7213e6d2d93 100644 --- a/engine/examples/apt-cacher-ng.md +++ b/engine/examples/apt-cacher-ng.md @@ -1,12 +1,12 @@ ---- -description: Installing and running an apt-cacher-ng service -keywords: -- docker, example, package installation, networking, debian, ubuntu -menu: - main: - parent: engine_dockerize -title: Dockerizing an apt-cacher-ng service ---- + # Dockerizing an apt-cacher-ng service diff --git a/engine/examples/couchbase.md b/engine/examples/couchbase.md index c00780c06a4..27607cb85dd 100644 --- a/engine/examples/couchbase.md +++ b/engine/examples/couchbase.md @@ -1,12 +1,12 @@ ---- -description: Dockerizing a Couchbase service -keywords: -- docker, example, package installation, networking, couchbase -menu: - main: - parent: engine_dockerize -title: Dockerizing a Couchbase service ---- + # Dockerizing a Couchbase service diff --git a/engine/examples/couchdb_data_volumes.md b/engine/examples/couchdb_data_volumes.md index 7e20ddd7ebe..972e78a7ada 100644 --- a/engine/examples/couchdb_data_volumes.md +++ b/engine/examples/couchdb_data_volumes.md @@ -1,12 +1,12 @@ ---- -description: Sharing data between 2 couchdb databases -keywords: -- docker, example, package installation, networking, couchdb, data volumes -menu: - main: - parent: engine_dockerize -title: Dockerizing a CouchDB service ---- + # Dockerizing a CouchDB service diff --git a/engine/examples/index.md b/engine/examples/index.md index ddf7d19c0f9..5a6cd78ce64 100644 --- a/engine/examples/index.md +++ b/engine/examples/index.md @@ -1,14 +1,14 @@ ---- -description: Provides examples for using Docker -keywords: -- dockerize, dockerizing apps, dockerizing applications, container, containers -menu: - main: - identifier: engine_dockerize - parent: engine_use - weight: 8 -title: Dockerize an application ---- + # Dockerize an application diff --git a/engine/examples/mongodb.md b/engine/examples/mongodb.md index 15af6ca255e..3173aa1b7ee 100644 --- a/engine/examples/mongodb.md +++ b/engine/examples/mongodb.md @@ -1,15 +1,12 @@ ---- -description: Creating a Docker image with MongoDB pre-installed using a Dockerfile - and sharing the image on Docker Hub -keywords: -- docker, dockerize, dockerizing, article, example, docker.io, platform, package, - installation, networking, mongodb, containers, images, image, sharing, dockerfile, - build, auto-building, framework -menu: - main: - parent: engine_dockerize -title: Dockerizing MongoDB ---- + # Dockerizing MongoDB diff --git a/engine/examples/mongodb/Dockerfile b/engine/examples/mongodb/Dockerfile index 74872b675fc..aea59c155f8 100644 --- a/engine/examples/mongodb/Dockerfile +++ b/engine/examples/mongodb/Dockerfile @@ -1,7 +1,3 @@ ---- -{} ---- - # Dockerizing MongoDB: Dockerfile for building MongoDB images # Based on ubuntu:16.04, installs MongoDB following the instructions from: # http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ diff --git a/engine/examples/postgresql_service.md b/engine/examples/postgresql_service.md index e43fa89b89a..8d5f675260d 100644 --- a/engine/examples/postgresql_service.md +++ b/engine/examples/postgresql_service.md @@ -1,12 +1,12 @@ ---- -description: Running and installing a PostgreSQL service -keywords: -- docker, example, package installation, postgresql -menu: - main: - parent: engine_dockerize -title: Dockerizing PostgreSQL ---- + # Dockerizing PostgreSQL diff --git a/engine/examples/running_redis_service.md b/engine/examples/running_redis_service.md index bae2819c711..66d852206e8 100644 --- a/engine/examples/running_redis_service.md +++ b/engine/examples/running_redis_service.md @@ -1,12 +1,12 @@ ---- -description: Installing and running a redis service -keywords: -- docker, example, package installation, networking, redis -menu: - main: - parent: engine_dockerize -title: Dockerizing a Redis service ---- + # Dockerizing a Redis service diff --git a/engine/examples/running_riak_service.md b/engine/examples/running_riak_service.md index d487ed88ecc..f17969fe481 100644 --- a/engine/examples/running_riak_service.md +++ b/engine/examples/running_riak_service.md @@ -1,12 +1,12 @@ ---- -description: Build a Docker image with Riak pre-installed -keywords: -- docker, example, package installation, networking, riak -menu: - main: - parent: engine_dockerize -title: Dockerizing a Riak service ---- + # Dockerizing a Riak service diff --git a/engine/examples/running_ssh_service.md b/engine/examples/running_ssh_service.md index 4369dc63a4d..3085a8e8e55 100644 --- a/engine/examples/running_ssh_service.md +++ b/engine/examples/running_ssh_service.md @@ -1,12 +1,12 @@ ---- -description: Installing and running an SSHd service on Docker -keywords: -- docker, example, package installation, networking -menu: - main: - parent: engine_dockerize -title: Dockerizing an SSH service ---- + # Dockerizing an SSH daemon service diff --git a/engine/examples/supervisord.conf b/engine/examples/supervisord.conf index 8bc3b66d825..385fbe7a416 100644 --- a/engine/examples/supervisord.conf +++ b/engine/examples/supervisord.conf @@ -1,5 +1,3 @@ - - [supervisord] nodaemon=true diff --git a/engine/extend/index.md b/engine/extend/index.md index 7cd3ebf56c2..4ce1eac1c54 100644 --- a/engine/extend/index.md +++ b/engine/extend/index.md @@ -1,24 +1,25 @@ ---- -advisory: experimental -aliases: -- /engine/extend/ -description: How develop and use a plugin with the managed plugin system -keywords: -- API, Usage, plugins, documentation, developer -menu: - main: - parent: engine_extend - weight: 1 -title: Managed plugin system ---- + # Docker Engine managed plugin system This document describes the plugin system available today in the **experimental build** of Docker 1.12: -* [How to operate an existing plugin](index.md#how-to-operate-a-plugin) -* [How to develop a plugin](index.md#how-to-develop-a-plugin) +* [How to operate an existing plugin](#how-to-operate-a-plugin) +* [How to develop a plugin](#how-to-develop-a-plugin) Unlike the legacy plugin system, you now manage plugins using Docker Engine: diff --git a/engine/extend/legacy_plugins.md b/engine/extend/legacy_plugins.md index 500b3a9f972..aa4fa4a9b34 100644 --- a/engine/extend/legacy_plugins.md +++ b/engine/extend/legacy_plugins.md @@ -1,14 +1,14 @@ ---- -aliases: /engine/extend/plugins/ -description: How to add additional functionality to Docker with plugins extensions -keywords: -- Examples, Usage, plugins, docker, documentation, user guide -menu: - main: - parent: engine_extend - weight: 3 -title: Use Docker Engine plugins ---- + # Use Docker Engine plugins diff --git a/engine/extend/manifest.md b/engine/extend/manifest.md index 899e94e6080..d47efce8e8b 100644 --- a/engine/extend/manifest.md +++ b/engine/extend/manifest.md @@ -1,16 +1,17 @@ ---- -advisory: experimental -aliases: -- /engine/extend/ -description: How develop and use a plugin with the managed plugin system -keywords: -- API, Usage, plugins, documentation, developer -menu: - main: - parent: engine_extend - weight: 1 -title: Plugin manifest ---- + # Plugin Manifest Version 0 of Plugin V2 diff --git a/engine/extend/menu.md b/engine/extend/menu.md index 4faddc87b88..4b9955038a8 100644 --- a/engine/extend/menu.md +++ b/engine/extend/menu.md @@ -1,14 +1,15 @@ ---- -description: Develop plugins and use existing plugins for Docker Engine -keywords: -- extend, plugins, docker, documentation, developer -menu: - main: - identifier: engine_extend - parent: engine_use - weight: 0 -title: Implement plugins -type: menu ---- + + diff --git a/engine/extend/plugin_api.md b/engine/extend/plugin_api.md index ff86d4fd408..5801ba91518 100644 --- a/engine/extend/plugin_api.md +++ b/engine/extend/plugin_api.md @@ -1,15 +1,13 @@ ---- -aliases: - - /extend/plugin_api/ -description: 'How to write Docker plugins extensions ' -keywords: -- API, Usage, plugins, documentation, developer -menu: - main: - parent: engine_extend - weight: 7 -title: Plugins API ---- + # Docker Plugin API @@ -28,7 +26,7 @@ If you just want to learn about or use Docker plugins, look A plugin is a process running on the same or a different host as the docker daemon, which registers itself by placing a file on the same docker host in one of the plugin -directories described in [Plugin discovery](plugin_api.md#plugin-discovery). +directories described in [Plugin discovery](#plugin-discovery). Plugins have human-readable names, which are short, lowercase strings. For example, `flocker` or `weave`. diff --git a/engine/extend/plugins_authorization.md b/engine/extend/plugins_authorization.md index bf2ffc1ad68..2c3d79e25d1 100644 --- a/engine/extend/plugins_authorization.md +++ b/engine/extend/plugins_authorization.md @@ -1,16 +1,15 @@ ---- -aliases: -- /engine/extend/authorization/ -description: How to create authorization plugins to manage access control to your - Docker daemon. -keywords: -- security, authorization, authentication, docker, documentation, plugin, extend -menu: - main: - parent: engine_extend - weight: 4 -title: Access authorization plugin ---- + + # Create an authorization plugin @@ -109,6 +108,8 @@ support the Docker client interactions detailed in this section. Enable the authorization plugin with a dedicated command line flag in the `--authorization-plugin=PLUGIN_ID` format. The flag supplies a `PLUGIN_ID` value. This value can be the plugin’s socket or a path to a specification file. +Authorization plugins can be loaded without restarting the daemon. Refer +to the [`dockerd` documentation](../reference/commandline/dockerd.md#configuration-reloading) for more information. ```bash $ dockerd --authorization-plugin=plugin1 --authorization-plugin=plugin2,... diff --git a/engine/extend/plugins_network.md b/engine/extend/plugins_network.md index 6543c96ee74..7a107e2ce3f 100644 --- a/engine/extend/plugins_network.md +++ b/engine/extend/plugins_network.md @@ -1,13 +1,13 @@ ---- -description: Network driver plugins. -keywords: -- Examples, Usage, plugins, docker, documentation, user guide -menu: - main: - parent: engine_extend - weight: 5 -title: Docker network driver plugins ---- + # Engine network driver plugins diff --git a/engine/extend/plugins_volume.md b/engine/extend/plugins_volume.md index db5fc0da888..f9c93a3de11 100644 --- a/engine/extend/plugins_volume.md +++ b/engine/extend/plugins_volume.md @@ -1,13 +1,13 @@ ---- -description: How to manage data with external volume plugins -keywords: -- Examples, Usage, volume, docker, data, volumes, plugin, api -menu: - main: - parent: engine_extend - weight: 6 -title: Volume plugins ---- + # Write a volume plugin diff --git a/engine/faq.md b/engine/faq.md index d7dce96b80e..b017557cb5d 100644 --- a/engine/faq.md +++ b/engine/faq.md @@ -1,16 +1,15 @@ ---- -aliases: -- /engine/misc/faq/ -description: Most frequently asked questions. -keywords: -- faq, questions, documentation, docker -menu: - main: - identifier: engine_faq - parent: engine_use - weight: 80 -title: FAQ ---- + # Frequently Asked Questions (FAQ) diff --git a/engine/getstarted/index.md b/engine/getstarted/index.md index ca0eb42743c..6619e9ae029 100644 --- a/engine/getstarted/index.md +++ b/engine/getstarted/index.md @@ -1,19 +1,21 @@ ---- -aliases: -- /mac/started/ -- /windows/started/ -- /linux/started/ -- /getting-started/ -description: Getting started with Docker -keywords: -- beginner, getting started, Docker -menu: - main: - identifier: getstart_all - parent: tutorial_getstart_menu - weight: "-1" -title: Get Started with Docker ---- + + # Get Started with Docker diff --git a/engine/getstarted/last_page.md b/engine/getstarted/last_page.md index 3a7cae736f8..9709ba9caa7 100644 --- a/engine/getstarted/last_page.md +++ b/engine/getstarted/last_page.md @@ -1,18 +1,19 @@ ---- -aliases: -- /mac/last_page/ -- /windows/last_page/ -- /linux/last_page/ -description: Getting started with Docker -keywords: -- beginner, getting started, Docker -menu: - main: - identifier: getstart_learn_more - parent: tutorial_getstart_menu - weight: 7 -title: Learning more ---- + # Learning more @@ -29,23 +30,23 @@ Depending on your interest, the Docker documentation contains a wealth of inform More about Docker for Mac, features, examples, FAQs, relationship to Docker Machine and Docker Toolbox, and how this fits in the Docker ecosystem - Getting Started with Docker for Mac + [Getting Started with Docker for Mac](https://docs.docker.com/docker-for-mac/) More about Docker for Windows, features, examples, FAQs, relationship to Docker Machine and Docker Toolbox, and how this fits in the Docker ecosystem - Getting Started with Docker for Windows + [Getting Started with Docker for Windows](https://docs.docker.com/docker-for-windows/) More about Docker Toolbox - Docker Toolbox Overview + [Docker Toolbox Overview](/toolbox/overview.md) More about Docker for Linux distributions - Install Docker Engine on Linux + [Install Docker Engine on Linux](/engine/installation/linux/index.md) More advanced tutorials on running containers, building your own images, networking containers, managing data for containers, and storing images on Docker Hub - Learn by example + [Learn by example](/engine/tutorials/index.md) Information about the Docker product line @@ -54,10 +55,16 @@ Depending on your interest, the Docker documentation contains a wealth of inform How to set up an automated build on Docker Hub - Docker Hub documentation + Docker Hub documentation How to run a multi-container application with Compose - Docker Compose documentation + [Docker Compose documentation](/compose/overview.md) + + + + + +  diff --git a/engine/getstarted/linux_install_help.md b/engine/getstarted/linux_install_help.md index d2e6051431a..c808251bdbe 100644 --- a/engine/getstarted/linux_install_help.md +++ b/engine/getstarted/linux_install_help.md @@ -1,14 +1,14 @@ ---- -aliases: -- /mac/started/ -description: Getting started with Docker -identifier: getstart_linux_install -keywords: -- beginner, getting started, Docker, install -parent: tutorial_getstart_menu -title: Install Docker and run hello-world -weight: "-80" ---- + # Example: Install Docker on Ubuntu Linux diff --git a/engine/getstarted/menu.md b/engine/getstarted/menu.md index e7e07d5596e..f447c667e5e 100644 --- a/engine/getstarted/menu.md +++ b/engine/getstarted/menu.md @@ -1,15 +1,16 @@ ---- -aliases: [] -description: Docker Mac -keywords: -- beginner, getting started, Docker -menu: - main: - identifier: tutorial_getstart_menu - parent: engine_use - weight: -80 -title: Get Started with Docker -type: menu ---- + # Get Started with Docker diff --git a/engine/getstarted/step_five.md b/engine/getstarted/step_five.md index 2f0ea1c411a..7cb0ffa984c 100644 --- a/engine/getstarted/step_five.md +++ b/engine/getstarted/step_five.md @@ -1,18 +1,19 @@ ---- -aliases: -- /mac/step_five/ -- /windows/step_five/ -- /linux/step_five/ -description: Getting started with Docker -keywords: -- beginner, getting started, Docker -menu: - main: - identifier: getstart_docker_hub - parent: tutorial_getstart_menu - weight: 5 -title: Create a Docker Hub account & repository ---- + # Create a Docker Hub account & repository diff --git a/engine/getstarted/step_four.md b/engine/getstarted/step_four.md index 8db84a56de0..81b1194a0d1 100644 --- a/engine/getstarted/step_four.md +++ b/engine/getstarted/step_four.md @@ -1,18 +1,19 @@ ---- -aliases: -- /mac/step_four/ -- /windows/step_four/ -- /linux/step_four/ -description: Getting started with Docker -keywords: -- beginner, getting started, Docker -menu: - main: - identifier: getstart_build_image - parent: tutorial_getstart_menu - weight: 4 -title: Build your own image ---- + # Build your own image diff --git a/engine/getstarted/step_one.md b/engine/getstarted/step_one.md index 57aa06647da..81821617a60 100644 --- a/engine/getstarted/step_one.md +++ b/engine/getstarted/step_one.md @@ -1,24 +1,25 @@ ---- -aliases: -- /mac/step_one/ -- /windows/step_one/ -- /linux/step_one/ -description: Getting started with Docker -keywords: -- beginner, getting started, Docker, install -menu: - main: - identifier: getstart_all_install - parent: tutorial_getstart_menu - weight: 1 -title: Install Docker and run hello-world ---- + # Install Docker -- [Step 1: Get Docker](step_one.md#step-1-get-docker) -- [Step 2: Install Docker](step_one.md#step-2-install-docker) -- [Step 3: Verify your installation](step_one.md#step-3-verify-your-installation) +- [Step 1: Get Docker](#step-1-get-docker) +- [Step 2: Install Docker](#step-2-install-docker) +- [Step 3: Verify your installation](#step-3-verify-your-installation) ## Step 1: Get Docker diff --git a/engine/getstarted/step_six.md b/engine/getstarted/step_six.md index f944d9990e2..18a6a118d45 100644 --- a/engine/getstarted/step_six.md +++ b/engine/getstarted/step_six.md @@ -1,18 +1,20 @@ ---- -aliases: -- /mac/step_six/ -- /windows/step_six/ -- /linux/step_six/ -description: Getting started with Docker -keywords: -- beginner, getting started, Docker -menu: - main: - identifier: getstart_tag_push_pull - parent: tutorial_getstart_menu - weight: 6 -title: Tag, push, & pull your image ---- + + # Tag, push, and pull your image diff --git a/engine/getstarted/step_three.md b/engine/getstarted/step_three.md index 1aaacc600f6..aaf77ef5085 100644 --- a/engine/getstarted/step_three.md +++ b/engine/getstarted/step_three.md @@ -1,18 +1,19 @@ ---- -aliases: -- /mac/step_three/ -- /windows/step_three/ -- /linux/step_three/ -description: Getting started with Docker -keywords: -- beginner, getting started, Docker -menu: - main: - identifier: getstart_locate - parent: tutorial_getstart_menu - weight: 3 -title: Find & run the whalesay image ---- + # Find and run the whalesay image @@ -22,7 +23,7 @@ image you'll use in the rest of this getting started. ## Step 1: Locate the whalesay image -1. Open your browser and [browse to the Docker Hub](https://hub.docker.com/?utm_source=getting_started_guide&utm_medium=embedded_MacOSX&utm_campaign=find_whalesay). +1. Open your browser and browse to the Docker Hub. ![Browse Docker Hub](tutimg/browse_and_search.png) @@ -78,15 +79,15 @@ Make sure Docker is running. On Docker for Mac and Docker for Windows, this is i ----- \ \ - \ - ## . - ## ## ## == - ## ## ## ## === - /""""""""""""""""___/ === - ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ - \______ o __/ - \ \ __/ - \____\______/ + \ + ## . + ## ## ## == + ## ## ## ## === + /""""""""""""""""___/ === + ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ + \______ o __/ + \ \ __/ + \____\______/ The first time you run a software image, the `docker` command looks for it on your local system. If the image isn't there, then `docker` gets it from @@ -120,15 +121,15 @@ Make sure Docker is running. On Docker for Mac and Docker for Windows, this is i --------- \ \ - \ - ## . - ## ## ## == - ## ## ## ## === - /""""""""""""""""___/ === - ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ - \______ o __/ - \ \ __/ - \____\______/ + \ + ## . + ## ## ## == + ## ## ## ## === + /""""""""""""""""___/ === + ~~~ {~~ ~~~~ ~~~ ~~~~ ~~ ~ / ===- ~~~ + \______ o __/ + \ \ __/ + \____\______/ ## Where to go next diff --git a/engine/getstarted/step_two.md b/engine/getstarted/step_two.md index 7b4d7b7fa18..820f9328ef1 100644 --- a/engine/getstarted/step_two.md +++ b/engine/getstarted/step_two.md @@ -1,18 +1,19 @@ ---- -aliases: -- /mac/step_two/ -- /windows/step_two/ -- /linux/step_two/ -description: Getting started with Docker -keywords: -- beginner, getting started, Docker -menu: - main: - identifier: getstart_understand - parent: tutorial_getstart_menu - weight: 2 -title: Understand images & containers ---- + # Learn about images & containers diff --git a/engine/index.md b/engine/index.md index abddc6b93b7..e2e28be06d9 100644 --- a/engine/index.md +++ b/engine/index.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/misc/ -description: Engine -keywords: -- Engine -menu: - main: - identifier: engine_use - weight: -85 -title: Docker Engine ---- + # About Docker Engine diff --git a/engine/installation/binaries.md b/engine/installation/binaries.md index 68b220e72f1..c9bff3844bc 100644 --- a/engine/installation/binaries.md +++ b/engine/installation/binaries.md @@ -1,14 +1,13 @@ ---- -description: Instructions for installing Docker as a binary. Mostly meant for hackers - who want to try out Docker on a variety of environments. -keywords: -- binaries, installation, docker, documentation, linux -menu: - main: - parent: engine_install - weight: 110 -title: Installation from binaries ---- + # Installation from binaries @@ -118,7 +117,7 @@ For example: > **Note** These instructions are for Docker Engine 1.11 and up. Engine 1.10 and > under consists of a single binary, and instructions for those versions are -> different. To install version 1.10 or below, follow the instructions in the +> different. To install version 1.10 or below, follow the instructions in the > 1.10 documentation. @@ -147,6 +146,9 @@ For example, to install the binaries in `/usr/bin`: $ mv docker/* /usr/bin/ ``` +> **Note**: Depending on your current setup, you can specify custom paths +> for some of the binaries provided. + > **Note**: If you already have Engine installed on your host, make sure you > stop Engine before installing (`killall docker`), and install the binaries > in the same location. You can find the location of the current installation @@ -245,7 +247,7 @@ daemon: $ killall docker -Then follow the [regular installation steps](binaries.md#get-the-linux-binaries). +Then follow the [regular installation steps](#get-the-linux-binaries). ## Next steps diff --git a/engine/installation/cloud/cloud-ex-aws.md b/engine/installation/cloud/cloud-ex-aws.md index 3ec00550525..0484f2481df 100644 --- a/engine/installation/cloud/cloud-ex-aws.md +++ b/engine/installation/cloud/cloud-ex-aws.md @@ -1,14 +1,12 @@ ---- -description: Example of a manual install of Docker Engine on a cloud provider, using - Amazon Web Services (AWS) EC2. Shows how to create an EC2 instance, and install - Docker Engine on it. -keywords: -- cloud, docker, machine, documentation, installation, AWS, EC2 -menu: - main: - parent: install_cloud -title: 'Example: Manual install on cloud provider' ---- + # Example: Manual install on cloud provider diff --git a/engine/installation/cloud/cloud-ex-machine-ocean.md b/engine/installation/cloud/cloud-ex-machine-ocean.md index 1fcf788c0b1..ddcc9562816 100644 --- a/engine/installation/cloud/cloud-ex-machine-ocean.md +++ b/engine/installation/cloud/cloud-ex-machine-ocean.md @@ -1,13 +1,12 @@ ---- -description: Example of using Docker Machine to install Docker Engine on a cloud provider, - using Digital Ocean. -keywords: -- cloud, docker, machine, documentation, installation, digitalocean -menu: - main: - parent: install_cloud -title: 'Example: Use Docker Machine to provision cloud hosts' ---- + # Example: Use Docker Machine to provision cloud hosts @@ -27,19 +26,19 @@ If you have not done so already, go to ` gets the host IP address and `docker-machine inspect ` lists all the details. - - ``` - $ docker-machine ip docker-sandbox - 104.131.43.236 - - $ docker-machine inspect docker-sandbox - { - "ConfigVersion": 3, - "Driver": { - "IPAddress": "104.131.43.236", - "MachineName": "docker-sandbox", - "SSHUser": "root", - "SSHPort": 22, - "SSHKeyPath": "/Users/samanthastevens/.docker/machine/machines/docker-sandbox/id_rsa", - "StorePath": "/Users/samanthastevens/.docker/machine", - "SwarmMaster": false, - "SwarmHost": "tcp://0.0.0.0:3376", - "SwarmDiscovery": "", - ... - ``` - -7. Verify Docker Engine is installed correctly by running `docker` commands. + $ docker-machine env docker-sandbox + export DOCKER_TLS_VERIFY="1" + export DOCKER_HOST="tcp://45.55.222.72:2376" + export DOCKER_CERT_PATH="/Users/victoriabialas/.docker/machine/machines/docker-sandbox" + export DOCKER_MACHINE_NAME="docker-sandbox" + # Run this command to configure your shell: + # eval "$(docker-machine env docker-sandbox)" + + $ eval "$(docker-machine env docker-sandbox)" + +5. Re-run `docker-machine ls` to verify that our new server is the active machine, as indicated by the asterisk (*) in the ACTIVE column. + + $ docker-machine ls + NAME ACTIVE DRIVER STATE URL SWARM + default - virtualbox Running tcp://192.168.99.100:2376 + docker-sandbox * digitalocean Running tcp://45.55.222.72:2376 + +6. Run some `docker-machine` commands to inspect the remote host. For example, `docker-machine ip ` gets the host IP address and `docker-machine inspect ` lists all the details. + + $ docker-machine ip docker-sandbox + 104.131.43.236 + + $ docker-machine inspect docker-sandbox + { + "ConfigVersion": 3, + "Driver": { + "IPAddress": "104.131.43.236", + "MachineName": "docker-sandbox", + "SSHUser": "root", + "SSHPort": 22, + "SSHKeyPath": "/Users/samanthastevens/.docker/machine/machines/docker-sandbox/id_rsa", + "StorePath": "/Users/samanthastevens/.docker/machine", + "SwarmMaster": false, + "SwarmHost": "tcp://0.0.0.0:3376", + "SwarmDiscovery": "", + ... + +7. Verify Docker Engine is installed correctly by running `docker` commands. Start with something basic like `docker run hello-world`, or for a more interesting test, run a Dockerized webserver on your new remote machine. In this example, the `-p` option is used to expose port 80 from the `nginx` container and make it accessible on port `8000` of the `docker-sandbox` host. - ``` - $ docker run -d -p 8000:80 --name webserver kitematic/hello-world-nginx - Unable to find image 'kitematic/hello-world-nginx:latest' locally - latest: Pulling from kitematic/hello-world-nginx - a285d7f063ea: Pull complete - 2d7baf27389b: Pull complete - ... - Digest: sha256:ec0ca6dcb034916784c988b4f2432716e2e92b995ac606e080c7a54b52b87066 - Status: Downloaded newer image for kitematic/hello-world-nginx:latest - 942dfb4a0eaae75bf26c9785ade4ff47ceb2ec2a152be82b9d7960e8b5777e65 - ``` + $ docker run -d -p 8000:80 --name webserver kitematic/hello-world-nginx + Unable to find image 'kitematic/hello-world-nginx:latest' locally + latest: Pulling from kitematic/hello-world-nginx + a285d7f063ea: Pull complete + 2d7baf27389b: Pull complete + ... + Digest: sha256:ec0ca6dcb034916784c988b4f2432716e2e92b995ac606e080c7a54b52b87066 + Status: Downloaded newer image for kitematic/hello-world-nginx:latest + 942dfb4a0eaae75bf26c9785ade4ff47ceb2ec2a152be82b9d7960e8b5777e65 In a web browser, go to `http://:8000` to bring up the webserver home page. You got the `` from the output of the `docker-machine ip ` command you ran in a previous step. Use the port you exposed in the `docker run` command. @@ -213,6 +196,6 @@ If you create a host with Docker Machine, but remove it through the cloud provid * [Use Docker Machine to provision hosts on cloud providers](https://docs.docker.com/machine/get-started-cloud/) -* [Install Docker Engine](../../installation/index.md) +* [Install Docker Engine](../../installation/index.md) * [Docker User Guide](../../userguide/intro.md) diff --git a/engine/installation/cloud/index.md b/engine/installation/cloud/index.md index ecb2e2315d3..c7a83d31d10 100644 --- a/engine/installation/cloud/index.md +++ b/engine/installation/cloud/index.md @@ -1,21 +1,22 @@ ---- -aliases: -- /engine/installation/amazon/ -- /engine/installation/google/ -- /engine/installation/softlayer/ -- /engine/installation/azure/ -- /engine/installation/rackspace/ -- /engine/installation/joyent/ -description: Cloud Installations -keywords: -- 'Docker install ' -menu: - main: - identifier: install_cloud - parent: engine_install - weight: "-60" -title: On cloud providers ---- + # Install Engine in the cloud diff --git a/engine/installation/cloud/overview.md b/engine/installation/cloud/overview.md index 7d996b73c18..e8b3bb7e943 100644 --- a/engine/installation/cloud/overview.md +++ b/engine/installation/cloud/overview.md @@ -1,15 +1,16 @@ ---- -aliases: -- /engine/installation/cloud/cloud/ -description: Installation instructions for Docker on cloud. -keywords: -- cloud, docker, machine, documentation, installation -menu: - main: - parent: install_cloud - weight: -3 -title: Choose how to install ---- + # Choose how to install diff --git a/engine/installation/index.md b/engine/installation/index.md index 9d7352e01ed..3d796ea2249 100644 --- a/engine/installation/index.md +++ b/engine/installation/index.md @@ -1,17 +1,15 @@ ---- -aliases: -- /engine/installation/linux/frugalware/ -- /engine/installation/frugalware/ -description: Lists the installation methods -keywords: -- 'Docker install ' -menu: - main: - identifier: engine_install - parent: engine_use - weight: "-81" -title: Install ---- + # Install Docker Engine diff --git a/engine/installation/linux/SUSE.md b/engine/installation/linux/SUSE.md index f8ad09df529..b0c024abd21 100644 --- a/engine/installation/linux/SUSE.md +++ b/engine/installation/linux/SUSE.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/installation/SUSE/ -description: Installation instructions for Docker on openSUSE and on SUSE Linux Enterprise. -keywords: -- openSUSE, SUSE Linux Enterprise, SUSE, SLE, docker, documentation, installation -menu: - main: - parent: engine_linux -title: Installation on openSUSE and SUSE Linux Enterprise ---- + # openSUSE and SUSE Linux Enterprise @@ -72,7 +71,7 @@ The `docker` package creates a new group named `docker`. Users, other than `root` user, must be part of this group to interact with the Docker daemon. You can add users with this command syntax: - sudo /usr/sbin/usermod -a -G docker + $ sudo /usr/sbin/usermod -a -G docker Once you add a user, make sure they relog to pick up these new permissions. diff --git a/engine/installation/linux/archlinux.md b/engine/installation/linux/archlinux.md index 46dbb13e9a6..b62b21c674f 100644 --- a/engine/installation/linux/archlinux.md +++ b/engine/installation/linux/archlinux.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/installation/archlinux/ -description: Installation instructions for Docker on ArchLinux. -keywords: -- arch linux, docker, documentation, installation -menu: - main: - parent: engine_linux -title: Installation on Arch Linux ---- + # Arch Linux diff --git a/engine/installation/linux/centos.md b/engine/installation/linux/centos.md index ecd2046459e..5239ac7670c 100644 --- a/engine/installation/linux/centos.md +++ b/engine/installation/linux/centos.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/installation/centos/ -description: Instructions for installing Docker on CentOS -keywords: -- Docker, Docker documentation, requirements, linux, centos, epel, docker.io, docker-io -menu: - main: - parent: engine_linux - weight: -4 -title: Installation on CentOS ---- + # CentOS @@ -42,21 +41,21 @@ packages. ## Install Docker Engine There are two ways to install Docker Engine. You can [install using the `yum` -package manager](centos.md#install-with-yum). Or you can use `curl` with the [`get.docker.com` -site](centos.md#install-with-the-script). This second method runs an installation script +package manager](#install-with-yum). Or you can use `curl` with the [`get.docker.com` +site](#install-with-the-script). This second method runs an installation script which also installs via the `yum` package manager. ### Install with yum 1. Log into your machine as a user with `sudo` or `root` privileges. -2. Make sure your existing packages are up-to-date. +2. Make sure your existing packages are up-to-date. ```bash $ sudo yum update ``` -3. Add the `yum` repo. +3. Add the `yum` repo. ```bash $ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF' @@ -69,19 +68,19 @@ which also installs via the `yum` package manager. EOF ``` -4. Install the Docker package. +4. Install the Docker package. ```bash $ sudo yum install docker-engine ``` -5. Enable the service. +5. Enable the service. ```bash $ sudo systemctl enable docker.service ``` -6. Start the Docker daemon. +6. Start the Docker daemon. ```bash $ sudo systemctl start docker @@ -125,13 +124,13 @@ learn how to [customize your Systemd Docker daemon options](../../admin/systemd. 1. Log into your machine as a user with `sudo` or `root` privileges. -2. Make sure your existing packages are up-to-date. +2. Make sure your existing packages are up-to-date. ```bash $ sudo yum update ``` -3. Run the Docker installation script. +3. Run the Docker installation script. ```bash $ curl -fsSL https://get.docker.com/ | sh @@ -139,19 +138,19 @@ learn how to [customize your Systemd Docker daemon options](../../admin/systemd. This script adds the `docker.repo` repository and installs Docker. -4. Enable the service. +4. Enable the service. ```bash $ sudo systemctl enable docker.service ``` -5. Start the Docker daemon. +5. Start the Docker daemon. ```bash $ sudo systemctl start docker ``` -6. Verify `docker` is installed correctly by running a test image in a container. +6. Verify `docker` is installed correctly by running a test image in a container. ```bash $ sudo docker run hello-world @@ -179,23 +178,23 @@ To create the `docker` group and add your user: 1. Log into your machine as a user with `sudo` or `root` privileges. -2. Create the `docker` group. +2. Create the `docker` group. ```bash $ sudo groupadd docker ``` -3. Add your user to `docker` group. +3. Add your user to `docker` group. ```bash $ sudo usermod -aG docker your_username` ``` -4. Log out and log back in. +4. Log out and log back in. This ensures your user is running with the correct permissions. -5. Verify that your user is in the docker group by running `docker` without `sudo`. +5. Verify that your user is in the docker group by running `docker` without `sudo`. ```bash $ docker run hello-world @@ -213,7 +212,7 @@ $ sudo systemctl enable docker You can uninstall the Docker software with `yum`. -1. List the installed Docker packages. +1. List the installed Docker packages. ```bash $ yum list installed | grep docker @@ -221,7 +220,7 @@ You can uninstall the Docker software with `yum`. docker-engine.x86_64 1.7.1-0.1.el7@/docker-engine-1.7.1-0.1.el7.x86_64 ``` -2. Remove the package. +2. Remove the package. ```bash $ sudo yum -y remove docker-engine.x86_64 @@ -230,7 +229,7 @@ You can uninstall the Docker software with `yum`. This command does not remove images, containers, volumes, or user-created configuration files on your host. -3. To delete all images, containers, and volumes, run the following command: +3. To delete all images, containers, and volumes, run the following command: ```bash $ rm -rf /var/lib/docker diff --git a/engine/installation/linux/cruxlinux.md b/engine/installation/linux/cruxlinux.md index b37d9dd6415..1d76cda2e9c 100644 --- a/engine/installation/linux/cruxlinux.md +++ b/engine/installation/linux/cruxlinux.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/installation/cruxlinux/ -description: Docker installation on CRUX Linux. -keywords: -- crux linux, Docker, documentation, installation -menu: - main: - parent: engine_linux -title: Installation on CRUX Linux ---- + # CRUX Linux diff --git a/engine/installation/linux/debian.md b/engine/installation/linux/debian.md index 82d064b3a85..51ee6a7bc61 100644 --- a/engine/installation/linux/debian.md +++ b/engine/installation/linux/debian.md @@ -1,23 +1,22 @@ ---- -aliases: -- /engine/installation/debian/ -description: Instructions for installing Docker on Debian. -keywords: -- Docker, Docker documentation, installation, debian -menu: - main: - parent: engine_linux - weight: -2 -title: Installation on Debian ---- + # Debian Docker is supported on the following versions of Debian: - - [*Debian testing stretch (64-bit)*](debian.md#debian-wheezy-stable-7-x-64-bit) - - [*Debian 8.0 Jessie (64-bit)*](debian.md#debian-jessie-80-64-bit) - - [*Debian 7.7 Wheezy (64-bit)*](debian.md#debian-wheezy-stable-7-x-64-bit) (backports required) + - [*Debian testing stretch (64-bit)*](#debian-wheezy-stable-7-x-64-bit) + - [*Debian 8.0 Jessie (64-bit)*](#debian-jessie-80-64-bit) + - [*Debian 7.7 Wheezy (64-bit)*](#debian-wheezy-stable-7-x-64-bit) (backports required) >**Note**: If you previously installed Docker using `APT`, make sure you update your `APT` sources to the new `APT` repository. diff --git a/engine/installation/linux/fedora.md b/engine/installation/linux/fedora.md index 7087e9e8b06..589dd07e5ad 100644 --- a/engine/installation/linux/fedora.md +++ b/engine/installation/linux/fedora.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/installation/fedora/ -description: Instructions for installing Docker on Fedora. -keywords: -- Docker, Docker documentation, Fedora, requirements, linux -menu: - main: - parent: engine_linux - weight: -3 -title: Installation on Fedora ---- + # Fedora @@ -40,21 +39,21 @@ packages. ## Install Docker Engine There are two ways to install Docker Engine. You can [install using the `dnf` -package manager](fedora.md#install-with-dnf). Or you can use `curl` [with the `get.docker.com` -site](fedora.md#install-with-the-script). This second method runs an installation script +package manager](#install-with-dnf). Or you can use `curl` [with the `get.docker.com` +site](#install-with-the-script). This second method runs an installation script which also installs via the `dnf` package manager. ### Install with DNF 1. Log into your machine as a user with `sudo` or `root` privileges. -2. Make sure your existing packages are up-to-date. +2. Make sure your existing packages are up-to-date. ```bash $ sudo dnf update ``` -3. Add the `yum` repo. +3. Add the `yum` repo. ```bash $ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF' @@ -67,19 +66,19 @@ which also installs via the `dnf` package manager. EOF ``` -4. Install the Docker package. +4. Install the Docker package. ```bash $ sudo dnf install docker-engine ``` -5. Enable the service. +5. Enable the service. ```bash $ sudo systemctl enable docker.service ``` -6. Start the Docker daemon. +6. Start the Docker daemon. ```bash $ sudo systemctl start docker @@ -125,13 +124,13 @@ You use the same installation procedure for all versions of Fedora. 1. Log into your machine as a user with `sudo` or `root` privileges. -2. Make sure your existing packages are up-to-date. +2. Make sure your existing packages are up-to-date. ```bash $ sudo dnf update ``` -3. Run the Docker installation script. +3. Run the Docker installation script. ```bash $ curl -fsSL https://get.docker.com/ | sh @@ -139,19 +138,19 @@ You use the same installation procedure for all versions of Fedora. This script adds the `docker.repo` repository and installs Docker. -4. Enable the service. +4. Enable the service. ```bash $ sudo systemctl enable docker.service ``` -5. Start the Docker daemon. +5. Start the Docker daemon. ```bash $ sudo systemctl start docker ``` -6. Verify `docker` is installed correctly by running a test image in a container. +6. Verify `docker` is installed correctly by running a test image in a container. ```bash $ sudo docker run hello-world @@ -179,13 +178,13 @@ To create the `docker` group and add your user: 1. Log into your machine as a user with `sudo` or `root` privileges. -2. Create the `docker` group. +2. Create the `docker` group. ```bash $ sudo groupadd docker ``` -3. Add your user to `docker` group. +3. Add your user to `docker` group. ```bash $ sudo usermod -aG docker your_username` @@ -195,7 +194,7 @@ To create the `docker` group and add your user: This ensures your user is running with the correct permissions. -5. Verify that your user is in the docker group by running `docker` without `sudo`. +5. Verify that your user is in the docker group by running `docker` without `sudo`. ```bash $ docker run hello-world @@ -232,7 +231,7 @@ This configuration allows IP forwarding from the container as expected. You can uninstall the Docker software with `dnf`. -1. List the installed Docker packages. +1. List the installed Docker packages. ```bash $ dnf list installed | grep docker @@ -240,7 +239,7 @@ You can uninstall the Docker software with `dnf`. docker-engine.x86_64 1.7.1-0.1.fc21 @/docker-engine-1.7.1-0.1.fc21.el7.x86_64 ``` -2. Remove the package. +2. Remove the package. ```bash $ sudo dnf -y remove docker-engine.x86_64 @@ -249,7 +248,7 @@ You can uninstall the Docker software with `dnf`. This command does not remove images, containers, volumes, or user-created configuration files on your host. -3. To delete all images, containers, and volumes, run the following command: +3. To delete all images, containers, and volumes, run the following command: ```bash $ rm -rf /var/lib/docker diff --git a/engine/installation/linux/gentoolinux.md b/engine/installation/linux/gentoolinux.md index cb87d2f47ac..e3777483d17 100644 --- a/engine/installation/linux/gentoolinux.md +++ b/engine/installation/linux/gentoolinux.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/installation/gentoolinux/ -description: Installation instructions for Docker on Gentoo. -keywords: -- gentoo linux, docker, documentation, installation -menu: - main: - parent: engine_linux -title: Installation on Gentoo ---- + # Gentoo diff --git a/engine/installation/linux/index.md b/engine/installation/linux/index.md index a0d4868ce1e..de8db6072ae 100644 --- a/engine/installation/linux/index.md +++ b/engine/installation/linux/index.md @@ -1,17 +1,14 @@ ---- -description: Lists the installation methods -keywords: -- docker -- engine -- install -- linux -menu: - main: - identifier: engine_linux - parent: engine_install - weight: "-70" -title: On Linux distributions ---- + # Install Docker Engine on Linux diff --git a/engine/installation/linux/oracle.md b/engine/installation/linux/oracle.md index f99fd52de45..313daa672bb 100644 --- a/engine/installation/linux/oracle.md +++ b/engine/installation/linux/oracle.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/installation/oracle/ -description: Installation instructions for Docker on Oracle Linux. -keywords: -- Docker, Docker documentation, requirements, linux, rhel, centos, oracle, ol -menu: - main: - parent: engine_linux -title: Installation on Oracle Linux ---- + # Oracle Linux @@ -87,11 +86,11 @@ btrfs storage engine on both Oracle Linux 6 and 7. This section contains optional procedures for configuring your Oracle Linux to work better with Docker. -* [Create a docker group](oracle.md#create-a-docker-group) -* [Configure Docker to start on boot](oracle.md#configure-docker-to-start-on-boot) -* [Use the btrfs storage engine](oracle.md#use-the-btrfs-storage-engine) +* [Create a docker group](#create-a-docker-group) +* [Configure Docker to start on boot](#configure-docker-to-start-on-boot) +* [Use the btrfs storage engine](#use-the-btrfs-storage-engine) -### Create a Docker group +### Create a Docker group The `docker` daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user `root` and other users can access it with diff --git a/engine/installation/linux/rhel.md b/engine/installation/linux/rhel.md index db5734654e0..1122c32494a 100644 --- a/engine/installation/linux/rhel.md +++ b/engine/installation/linux/rhel.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/installation/rhel/ -description: Instructions for installing Docker on Red Hat Enterprise Linux. -keywords: -- Docker, Docker documentation, requirements, linux, rhel -menu: - main: - parent: engine_linux - weight: -5 -title: Installation on Red Hat Enterprise Linux ---- + # Red Hat Enterprise Linux @@ -38,21 +37,21 @@ packages. ## Install Docker Engine There are two ways to install Docker Engine. You can [install using the `yum` -package manager](rhel.md#install-with-yum). Or you can use `curl` with the [`get.docker.com` -site](rhel.md#install-with-the-script). This second method runs an installation script +package manager](#install-with-yum). Or you can use `curl` with the [`get.docker.com` +site](#install-with-the-script). This second method runs an installation script which also installs via the `yum` package manager. ### Install with yum -1. Log into your machine as a user with `sudo` or `root` privileges. +1. Log into your machine as a user with `sudo` or `root` privileges. -2. Make sure your existing packages are up-to-date. +2. Make sure your existing packages are up-to-date. ```bash $ sudo yum update ``` -3. Add the `yum` repo. +3. Add the `yum` repo. ```bash $ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF' @@ -65,19 +64,19 @@ which also installs via the `yum` package manager. EOF ``` -4. Install the Docker package. +4. Install the Docker package. ```bash $ sudo yum install docker-engine ``` -5. Enable the service. +5. Enable the service. ```bash $ sudo systemctl enable docker.service ``` -6. Start the Docker daemon. +6. Start the Docker daemon. ```bash $ sudo systemctl start docker @@ -119,15 +118,15 @@ learn how to [customize your Systemd Docker daemon options](../../admin/systemd. ### Install with the script -1. Log into your machine as a user with `sudo` or `root` privileges. +1. Log into your machine as a user with `sudo` or `root` privileges. -2. Make sure your existing packages are up-to-date. +2. Make sure your existing packages are up-to-date. ```bash $ sudo yum update ``` -3. Run the Docker installation script. +3. Run the Docker installation script. ```bash $ curl -fsSL https://get.docker.com/ | sh @@ -135,19 +134,19 @@ learn how to [customize your Systemd Docker daemon options](../../admin/systemd. This script adds the `docker.repo` repository and installs Docker. -4. Enable the service. +4. Enable the service. ```bash $ sudo systemctl enable docker.service ``` -5. Start the Docker daemon. +5. Start the Docker daemon. ```bash $ sudo systemctl start docker ``` -6. Verify `docker` is installed correctly by running a test image in a container. +6. Verify `docker` is installed correctly by running a test image in a container. ```bash $ sudo docker run hello-world @@ -173,25 +172,25 @@ makes the ownership of the Unix socket read/writable by the `docker` group. To create the `docker` group and add your user: -1. Log into your machine as a user with `sudo` or `root` privileges. +1. Log into your machine as a user with `sudo` or `root` privileges. -2. Create the `docker` group. +2. Create the `docker` group. ```bash $ sudo groupadd docker ``` -3. Add your user to `docker` group. +3. Add your user to `docker` group. ```bash $ sudo usermod -aG docker your_username` ``` -4. Log out and log back in. +4. Log out and log back in. This ensures your user is running with the correct permissions. -5. Verify that your user is in the docker group by running `docker` without `sudo`. +5. Verify that your user is in the docker group by running `docker` without `sudo`. ```bash $ docker run hello-world @@ -209,7 +208,7 @@ $ sudo systemctl enable docker You can uninstall the Docker software with `yum`. -1. List the installed Docker packages. +1. List the installed Docker packages. ```bash $ yum list installed | grep docker @@ -217,7 +216,7 @@ You can uninstall the Docker software with `yum`. docker-engine.x86_64 1.7.1-0.1.el7@/docker-engine-1.7.1-0.1.el7.x86_64 ``` -2. Remove the package. +2. Remove the package. ```bash $ sudo yum -y remove docker-engine.x86_64 @@ -226,7 +225,7 @@ You can uninstall the Docker software with `yum`. This command does not remove images, containers, volumes, or user-created configuration files on your host. -3. To delete all images, containers, and volumes, run the following command: +3. To delete all images, containers, and volumes, run the following command: ```bash $ rm -rf /var/lib/docker diff --git a/engine/installation/linux/ubuntulinux.md b/engine/installation/linux/ubuntulinux.md index ca3a65b3848..ca38e8c9585 100644 --- a/engine/installation/linux/ubuntulinux.md +++ b/engine/installation/linux/ubuntulinux.md @@ -1,21 +1,21 @@ ---- -aliases: -- /engine/installation/ubuntulinux/ -description: 'Instructions for installing Docker on Ubuntu. ' -keywords: -- Docker, Docker documentation, requirements, apt, installation, ubuntu -menu: - main: - parent: engine_linux - weight: -6 -title: 'Installation on Ubuntu ' ---- + # Ubuntu Docker is supported on these Ubuntu operating systems: - Ubuntu Xenial 16.04 (LTS) +- Ubuntu Wily 15.10 - Ubuntu Trusty 14.04 (LTS) - Ubuntu Precise 12.04 (LTS) @@ -82,6 +82,10 @@ packages from the new repository: deb https://apt.dockerproject.org/repo ubuntu-trusty main + - Ubuntu Wily 15.10 + + deb https://apt.dockerproject.org/repo ubuntu-wily main + - Ubuntu Xenial 16.04 (LTS) deb https://apt.dockerproject.org/repo ubuntu-xenial main @@ -111,9 +115,10 @@ packages from the new repository: ### Prerequisites by Ubuntu Version - Ubuntu Xenial 16.04 (LTS) +- Ubuntu Wily 15.10 - Ubuntu Trusty 14.04 (LTS) -For Ubuntu Trusty, and Xenial, it's recommended to install the +For Ubuntu Trusty, Wily, and Xenial, it's recommended to install the `linux-image-extra-*` kernel packages. The `linux-image-extra-*` packages allows you use the `aufs` storage driver. @@ -233,13 +238,13 @@ install Docker using the following: This section contains optional procedures for configuring your Ubuntu to work better with Docker. -* [Create a docker group](ubuntulinux.md#create-a-docker-group) -* [Adjust memory and swap accounting](ubuntulinux.md#adjust-memory-and-swap-accounting) -* [Enable UFW forwarding](ubuntulinux.md#enable-ufw-forwarding) -* [Configure a DNS server for use by Docker](ubuntulinux.md#configure-a-dns-server-for-use-by-docker) -* [Configure Docker to start on boot](ubuntulinux.md#configure-docker-to-start-on-boot) +* [Create a docker group](#create-a-docker-group) +* [Adjust memory and swap accounting](#adjust-memory-and-swap-accounting) +* [Enable UFW forwarding](#enable-ufw-forwarding) +* [Configure a DNS server for use by Docker](#configure-a-dns-server-for-use-by-docker) +* [Configure Docker to start on boot](#configure-docker-to-start-on-boot) -### Create a Docker group +### Create a Docker group The `docker` daemon binds to a Unix socket instead of a TCP port. By default that Unix socket is owned by the user `root` and other users can access it with diff --git a/engine/installation/mac.md b/engine/installation/mac.md index 01087578c12..444c42d5f27 100644 --- a/engine/installation/mac.md +++ b/engine/installation/mac.md @@ -1,21 +1,20 @@ ---- -description: Instructions for installing Docker on OS X using boot2docker. -keywords: -- Docker, Docker documentation, requirements, boot2docker, VirtualBox, SSH, Linux, - OSX, OS X, Mac -menu: - main: - parent: engine_install - weight: "-90" -title: Installation on Mac OS X ---- + # Mac OS X You have two options for installing Docker on Mac: -- [Docker for Mac](mac.md#docker-for-mac) -- [Docker Toolbox](mac.md#docker-toolbox) +- [Docker for Mac](#docker-for-mac) +- [Docker Toolbox](#docker-toolbox) ## Docker for Mac diff --git a/engine/installation/windows.md b/engine/installation/windows.md index 50e9ba54e54..bf269f4a70c 100644 --- a/engine/installation/windows.md +++ b/engine/installation/windows.md @@ -1,20 +1,20 @@ ---- -description: Docker installation on Microsoft Windows -keywords: -- Docker, Docker documentation, Windows, requirements, virtualbox, boot2docker -menu: - main: - parent: engine_install - weight: "-80" -title: Installation on Windows ---- + # Windows You have two options for installing Docker on Windows: -- [Docker for Windows](windows.md#docker-for-windows) -- [Docker Toolbox](windows.md#docker-toolbox) +- [Docker for Windows](#docker-for-windows) +- [Docker Toolbox](#docker-toolbox) ## Docker for Windows diff --git a/engine/migration.md b/engine/migration.md index 52ada60167b..28c2d7a4800 100644 --- a/engine/migration.md +++ b/engine/migration.md @@ -1,13 +1,13 @@ ---- -description: Migrate to Engine 1.10 -keywords: -- docker, documentation, engine, upgrade, migration -menu: - main: - parent: engine_use - weight: 79 -title: Migrate to Engine 1.10 ---- + # Migrate to Engine 1.10 diff --git a/engine/reference/api/README.md b/engine/reference/api/README.md index e96ccf08da2..36485223449 100644 --- a/engine/reference/api/README.md +++ b/engine/reference/api/README.md @@ -1,6 +1,8 @@ ---- -draft: true ---- + This directory holds the authoritative specifications of APIs defined and implemented by Docker. Currently this includes: diff --git a/engine/reference/api/docker-io_api.md b/engine/reference/api/docker-io_api.md index 3a172e5eb58..5e3c6844846 100644 --- a/engine/reference/api/docker-io_api.md +++ b/engine/reference/api/docker-io_api.md @@ -1,14 +1,14 @@ ---- -description: API Documentation for the Docker Hub API -draft: true -keywords: -- API, Docker, index, REST, documentation, Docker Hub, registry -menu: - main: - parent: engine_remoteapi - weight: 99 -title: Docker Hub API ---- + # Docker Hub API diff --git a/engine/reference/api/docker_io_accounts_api.md b/engine/reference/api/docker_io_accounts_api.md index 7c7b651b79f..dfee194b19e 100644 --- a/engine/reference/api/docker_io_accounts_api.md +++ b/engine/reference/api/docker_io_accounts_api.md @@ -1,13 +1,13 @@ ---- -description: API Documentation for docker.io accounts. -keywords: -- API, Docker, accounts, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: 90 -title: docker.io accounts API ---- + # docker.io accounts API diff --git a/engine/reference/api/docker_remote_api.md b/engine/reference/api/docker_remote_api.md index 194eab0bc66..91008b4e170 100644 --- a/engine/reference/api/docker_remote_api.md +++ b/engine/reference/api/docker_remote_api.md @@ -1,13 +1,13 @@ ---- -description: API Documentation for Docker -keywords: -- API, Docker, rcli, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: -99 -title: Remote API ---- + # Docker Remote API @@ -35,15 +35,16 @@ If you have bound the Docker daemon to a different socket path or TCP port, you would reference that in your cURL rather than the default. -The current version of the API is v1.24 which means calling `/info` is the same -as calling `/v1.24/info`. To call an older version of the API use -`/v1.23/info`. If a newer daemon is installed, new properties may be returned +The current version of the API is v1.25 which means calling `/info` is the same +as calling `/v1.25/info`. To call an older version of the API use +`/v1.24/info`. If a newer daemon is installed, new properties may be returned even when calling older versions of the API. Use the table below to find the API version for a Docker version: Docker version | API version | Changes ----------------|------------------------------------|------------------------------------------------------ +1.13.x | [1.25](docker_remote_api_v1.25.md) | [API changes](docker_remote_api.md#v1-25-api-changes) 1.12.x | [1.24](docker_remote_api_v1.24.md) | [API changes](docker_remote_api.md#v1-24-api-changes) 1.11.x | [1.23](docker_remote_api_v1.23.md) | [API changes](docker_remote_api.md#v1-23-api-changes) 1.10.x | [1.22](docker_remote_api_v1.22.md) | [API changes](docker_remote_api.md#v1-22-api-changes) @@ -111,6 +112,28 @@ Running `docker rmi` emits an **untag** event when removing an image name. The This section lists each version from latest to oldest. Each listing includes a link to the full documentation set and the changes relevant in that release. +### v1.25 API changes + +[Docker Remote API v1.25](docker_remote_api_v1.25.md) documentation + +* `GET /images/(name)/json` now returns `OsVersion` if populated +* `GET /info` now returns `Isolation`. +* `POST /containers/create` now takes `AutoRemove` in HostConfig, to enable auto-removal of the container on daemon side when the container's process exits. +* `GET /containers/json` and `GET /containers/(id or name)/json` now return `"removing"` as a value for the `State.Status` field if the container is being removed. Previously, "exited" was returned as status. +* `GET /containers/json` now accepts `removing` as a valid value for the `status` filter. +* `DELETE /volumes/(name)` now accepts a `force` query parameter to force removal of volumes that were already removed out of band by the volume driver plugin. +* `POST /containers/create/` and `POST /containers/(name)/update` now validates restart policies. +* `POST /containers/create` now validates IPAMConfig in NetworkingConfig, and returns error for invalid IPv4 and IPv6 addresses (`--ip` and `--ip6` in `docker create/run`). +* `POST /containers/create` now takes a `Mounts` field in `HostConfig` which replaces `Binds` and `Volumes`. *note*: `Binds` and `Volumes` are still available but are exclusive with `Mounts` +* `POST /build` now performs a preliminary validation of the `Dockerfile` before starting the build, and returns an error if the syntax is incorrect. Note that this change is _unversioned_ and applied to all API versions. +* `POST /build` accepts `cachefrom` parameter to specify images used for build cache. +* `GET /networks/` endpoint now correctly returns a list of *all* networks, + instead of the default network if a trailing slash is provided, but no `name` + or `id`. +* `DELETE /containers/(name)` endpoint now returns an error of `removal of container name is already in progress` with status code of 400, when container name is in a state of removal in progress. +* `GET /containers/json` now supports a `is-task` filter to filter + containers that are tasks (part of a service in swarm mode). + ### v1.24 API changes [Docker Remote API v1.24](docker_remote_api_v1.24.md) documentation diff --git a/engine/reference/api/docker_remote_api_v1.18.md b/engine/reference/api/docker_remote_api_v1.18.md index 63c31275548..b3616f6b796 100644 --- a/engine/reference/api/docker_remote_api_v1.18.md +++ b/engine/reference/api/docker_remote_api_v1.18.md @@ -1,13 +1,13 @@ ---- -description: API Documentation for Docker -keywords: -- API, Docker, rcli, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: 3 -title: Remote API v1.18 ---- + # Docker Remote API v1.18 @@ -523,9 +523,7 @@ Get `stdout` and `stderr` logs from the container ``id`` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -600,9 +598,7 @@ Export the contents of container `id` HTTP/1.1 200 OK Content-Type: application/octet-stream - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -733,7 +729,7 @@ Start the container `id` > **Note**: > For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. -> See [create a container](docker_remote_api_v1.18.md#create-a-container) for details. +> See [create a container](#create-a-container) for details. **Example request**: @@ -906,9 +902,7 @@ Attach to the container `id` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -934,7 +928,7 @@ Attach to the container `id` When using the TTY setting is enabled in [`POST /containers/create` -](docker_remote_api_v1.18.md#create-a-container), +](#create-a-container), the stream is the raw data from the process PTY and client's `stdin`. When the TTY is disabled, then the stream is multiplexed to separate `stdout` and `stderr`. @@ -988,9 +982,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet **Example response** - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1083,9 +1075,7 @@ Copy files or folders of container `id` HTTP/1.1 200 OK Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -1191,9 +1181,7 @@ Build an image from a Dockerfile POST /build HTTP/1.1 - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1216,6 +1204,10 @@ The archive may include any number of other files, which are accessible in the build context (See the [*ADD build command*](../../reference/builder.md#add)). +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + The build is canceled if the client drops the connection by quitting or being killed. @@ -1797,7 +1789,7 @@ If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image image (and its parents) are returned, but with the exclusion of the 'repositories' file in the tarball, as there were no image names referenced. -See the [image tarball format](docker_remote_api_v1.18.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -1826,7 +1818,7 @@ For each value of the `names` parameter: if it is a specific name and tag (e.g. an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. -See the [image tarball format](docker_remote_api_v1.18.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -1849,7 +1841,7 @@ See the [image tarball format](docker_remote_api_v1.18.md#image-tarball-format) `POST /images/load` Load a set of images and tags into a Docker repository. -See the [image tarball format](docker_remote_api_v1.18.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -1954,9 +1946,7 @@ interactive session with the `exec` command. HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream - {% raw %} {{ STREAM }} - {% endraw %} **JSON parameters**: diff --git a/engine/reference/api/docker_remote_api_v1.19.md b/engine/reference/api/docker_remote_api_v1.19.md index 4b045b8719c..3b4db54fd7f 100644 --- a/engine/reference/api/docker_remote_api_v1.19.md +++ b/engine/reference/api/docker_remote_api_v1.19.md @@ -1,13 +1,13 @@ ---- -description: API Documentation for Docker -keywords: -- API, Docker, rcli, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: 2 -title: Remote API v1.19 ---- + # Docker Remote API v1.19 @@ -537,9 +537,7 @@ Get `stdout` and `stderr` logs from the container ``id`` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -616,9 +614,7 @@ Export the contents of container `id` HTTP/1.1 200 OK Content-Type: application/octet-stream - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -770,7 +766,7 @@ Start the container `id` > **Note**: > For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. -> See [create a container](docker_remote_api_v1.19.md#create-a-container) for details. +> See [create a container](#create-a-container) for details. **Example request**: @@ -943,9 +939,7 @@ Attach to the container `id` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -971,7 +965,7 @@ Attach to the container `id` When using the TTY setting is enabled in [`POST /containers/create` -](docker_remote_api_v1.19.md#create-a-container), +](#create-a-container), the stream is the raw data from the process PTY and client's `stdin`. When the TTY is disabled, then the stream is multiplexed to separate `stdout` and `stderr`. @@ -1025,9 +1019,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet **Example response** - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1120,9 +1112,7 @@ Copy files or folders of container `id` HTTP/1.1 200 OK Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -1233,9 +1223,7 @@ Build an image from a Dockerfile POST /build HTTP/1.1 - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1258,6 +1246,10 @@ The archive may include any number of other files, which are accessible in the build context (See the [*ADD build command*](../../reference/builder.md#add)). +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + The build is canceled if the client drops the connection by quitting or being killed. @@ -1875,7 +1867,7 @@ If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image image (and its parents) are returned, but with the exclusion of the 'repositories' file in the tarball, as there were no image names referenced. -See the [image tarball format](docker_remote_api_v1.19.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -1904,7 +1896,7 @@ For each value of the `names` parameter: if it is a specific name and tag (e.g. an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. -See the [image tarball format](docker_remote_api_v1.19.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -1927,7 +1919,7 @@ See the [image tarball format](docker_remote_api_v1.19.md#image-tarball-format) `POST /images/load` Load a set of images and tags into a Docker repository. -See the [image tarball format](docker_remote_api_v1.19.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2035,9 +2027,7 @@ interactive session with the `exec` command. HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream - {% raw %} {{ STREAM }} - {% endraw %} **JSON parameters**: diff --git a/engine/reference/api/docker_remote_api_v1.20.md b/engine/reference/api/docker_remote_api_v1.20.md index e394e4a7680..698fa7a6a69 100644 --- a/engine/reference/api/docker_remote_api_v1.20.md +++ b/engine/reference/api/docker_remote_api_v1.20.md @@ -1,13 +1,13 @@ ---- -description: API Documentation for Docker -keywords: -- API, Docker, rcli, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: 1 -title: Remote API v1.20 ---- + # Docker Remote API v1.20 @@ -546,9 +546,7 @@ Get `stdout` and `stderr` logs from the container ``id`` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -625,9 +623,7 @@ Export the contents of container `id` HTTP/1.1 200 OK Content-Type: application/octet-stream - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -779,7 +775,7 @@ Start the container `id` > **Note**: > For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. -> See [create a container](docker_remote_api_v1.20.md#create-a-container) for details. +> See [create a container](#create-a-container) for details. **Example request**: @@ -952,9 +948,7 @@ Attach to the container `id` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -980,7 +974,7 @@ Attach to the container `id` When using the TTY setting is enabled in [`POST /containers/create` -](docker_remote_api_v1.20.md#create-a-container), +](#create-a-container), the stream is the raw data from the process PTY and client's `stdin`. When the TTY is disabled, then the stream is multiplexed to separate `stdout` and `stderr`. @@ -1034,9 +1028,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet **Example response** - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1131,9 +1123,7 @@ Copy files or folders of container `id` HTTP/1.1 200 OK Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -1179,9 +1169,7 @@ Get a tar archive of a resource in the filesystem of container `id`. Content-Type: application/x-tar X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= - {% raw %} {{ TAR STREAM }} - {% endraw %} On success, a response header `X-Docker-Container-Path-Stat` will be set to a base64-encoded JSON object containing some filesystem header information about @@ -1236,9 +1224,7 @@ Upload a tar archive to be extracted to a path in the filesystem of container PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1364,9 +1350,7 @@ Build an image from a Dockerfile POST /build HTTP/1.1 - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1389,6 +1373,10 @@ The archive may include any number of other files, which are accessible in the build context (See the [*ADD build command*](../../reference/builder.md#add)). +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + The build is canceled if the client drops the connection by quitting or being killed. @@ -2032,7 +2020,7 @@ If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image image (and its parents) are returned, but with the exclusion of the 'repositories' file in the tarball, as there were no image names referenced. -See the [image tarball format](docker_remote_api_v1.20.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2061,7 +2049,7 @@ For each value of the `names` parameter: if it is a specific name and tag (e.g. an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. -See the [image tarball format](docker_remote_api_v1.20.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2084,7 +2072,7 @@ See the [image tarball format](docker_remote_api_v1.20.md#image-tarball-format) `POST /images/load` Load a set of images and tags into a Docker repository. -See the [image tarball format](docker_remote_api_v1.20.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2192,9 +2180,7 @@ interactive session with the `exec` command. HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream - {% raw %} {{ STREAM }} - {% endraw %} **JSON parameters**: diff --git a/engine/reference/api/docker_remote_api_v1.21.md b/engine/reference/api/docker_remote_api_v1.21.md index 6fb9abe9357..e89605c807c 100644 --- a/engine/reference/api/docker_remote_api_v1.21.md +++ b/engine/reference/api/docker_remote_api_v1.21.md @@ -1,13 +1,13 @@ ---- -description: API Documentation for Docker -keywords: -- API, Docker, rcli, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: -2 -title: Remote API v1.21 ---- + # Docker Remote API v1.21 @@ -615,9 +615,7 @@ Get `stdout` and `stderr` logs from the container ``id`` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -694,9 +692,7 @@ Export the contents of container `id` HTTP/1.1 200 OK Content-Type: application/octet-stream - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -860,7 +856,7 @@ Start the container `id` > **Note**: > For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. -> See [create a container](docker_remote_api_v1.21.md#create-a-container) for details. +> See [create a container](#create-a-container) for details. **Example request**: @@ -1033,9 +1029,7 @@ Attach to the container `id` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1061,7 +1055,7 @@ Attach to the container `id` When using the TTY setting is enabled in [`POST /containers/create` -](docker_remote_api_v1.21.md#create-a-container), +](#create-a-container), the stream is the raw data from the process PTY and client's `stdin`. When the TTY is disabled, then the stream is multiplexed to separate `stdout` and `stderr`. @@ -1115,9 +1109,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet **Example response** - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1212,9 +1204,7 @@ Copy files or folders of container `id` HTTP/1.1 200 OK Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -1260,9 +1250,7 @@ Get a tar archive of a resource in the filesystem of container `id`. Content-Type: application/x-tar X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= - {% raw %} {{ TAR STREAM }} - {% endraw %} On success, a response header `X-Docker-Container-Path-Stat` will be set to a base64-encoded JSON object containing some filesystem header information about @@ -1317,9 +1305,7 @@ Upload a tar archive to be extracted to a path in the filesystem of container PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1445,9 +1431,7 @@ Build an image from a Dockerfile POST /build HTTP/1.1 - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1470,6 +1454,10 @@ The archive may include any number of other files, which are accessible in the build context (See the [*ADD build command*](../../reference/builder.md#add)). +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + The build is canceled if the client drops the connection by quitting or being killed. @@ -2186,7 +2174,7 @@ If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image image (and its parents) are returned, but with the exclusion of the 'repositories' file in the tarball, as there were no image names referenced. -See the [image tarball format](docker_remote_api_v1.21.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2215,7 +2203,7 @@ For each value of the `names` parameter: if it is a specific name and tag (e.g. an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. -See the [image tarball format](docker_remote_api_v1.21.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2238,7 +2226,7 @@ See the [image tarball format](docker_remote_api_v1.21.md#image-tarball-format) `POST /images/load` Load a set of images and tags into a Docker repository. -See the [image tarball format](docker_remote_api_v1.21.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2350,9 +2338,7 @@ interactive session with the `exec` command. HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream - {% raw %} {{ STREAM }} - {% endraw %} **JSON parameters**: diff --git a/engine/reference/api/docker_remote_api_v1.22.md b/engine/reference/api/docker_remote_api_v1.22.md index 931b7ba45d8..1f6d4c192e6 100644 --- a/engine/reference/api/docker_remote_api_v1.22.md +++ b/engine/reference/api/docker_remote_api_v1.22.md @@ -1,13 +1,13 @@ ---- -description: API Documentation for Docker -keywords: -- API, Docker, rcli, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: -3 -title: Remote API v1.22 ---- + # Docker Remote API v1.22 @@ -740,9 +740,7 @@ Get `stdout` and `stderr` logs from the container ``id`` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -819,9 +817,7 @@ Export the contents of container `id` HTTP/1.1 200 OK Content-Type: application/octet-stream - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -985,7 +981,7 @@ Start the container `id` > **Note**: > For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. -> See [create a container](docker_remote_api_v1.22.md#create-a-container) for details. +> See [create a container](#create-a-container) for details. **Example request**: @@ -1204,9 +1200,7 @@ Attach to the container `id` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1236,7 +1230,7 @@ Attach to the container `id` When using the TTY setting is enabled in [`POST /containers/create` -](docker_remote_api_v1.22.md#create-a-container), +](#create-a-container), the stream is the raw data from the process PTY and client's `stdin`. When the TTY is disabled, then the stream is multiplexed to separate `stdout` and `stderr`. @@ -1290,9 +1284,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet **Example response** - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1390,9 +1382,7 @@ Copy files or folders of container `id` HTTP/1.1 200 OK Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -1438,9 +1428,7 @@ Get a tar archive of a resource in the filesystem of container `id`. Content-Type: application/x-tar X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= - {% raw %} {{ TAR STREAM }} - {% endraw %} On success, a response header `X-Docker-Container-Path-Stat` will be set to a base64-encoded JSON object containing some filesystem header information about @@ -1495,9 +1483,7 @@ Upload a tar archive to be extracted to a path in the filesystem of container PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1623,9 +1609,7 @@ Build an image from a Dockerfile POST /build HTTP/1.1 - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1648,6 +1632,10 @@ The archive may include any number of other files, which are accessible in the build context (See the [*ADD build command*](../../reference/builder.md#add)). +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + The build is canceled if the client drops the connection by quitting or being killed. @@ -2576,7 +2564,7 @@ If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image image (and its parents) are returned, but with the exclusion of the 'repositories' file in the tarball, as there were no image names referenced. -See the [image tarball format](docker_remote_api_v1.22.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2605,7 +2593,7 @@ For each value of the `names` parameter: if it is a specific name and tag (e.g. an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. -See the [image tarball format](docker_remote_api_v1.22.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2628,7 +2616,7 @@ See the [image tarball format](docker_remote_api_v1.22.md#image-tarball-format) `POST /images/load` Load a set of images and tags into a Docker repository. -See the [image tarball format](docker_remote_api_v1.22.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2744,9 +2732,7 @@ interactive session with the `exec` command. HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream - {% raw %} {{ STREAM }} - {% endraw %} **JSON parameters**: diff --git a/engine/reference/api/docker_remote_api_v1.23.md b/engine/reference/api/docker_remote_api_v1.23.md index 2adfbb5e004..d188f79d363 100644 --- a/engine/reference/api/docker_remote_api_v1.23.md +++ b/engine/reference/api/docker_remote_api_v1.23.md @@ -1,13 +1,13 @@ ---- -description: API Documentation for Docker -keywords: -- API, Docker, rcli, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: -4 -title: Remote API v1.23 ---- + # Docker Remote API v1.23 @@ -766,9 +766,7 @@ Get `stdout` and `stderr` logs from the container ``id`` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -845,9 +843,7 @@ Export the contents of container `id` HTTP/1.1 200 OK Content-Type: application/octet-stream - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -1014,7 +1010,7 @@ Start the container `id` > **Note**: > For backwards compatibility, this endpoint accepts a `HostConfig` as JSON-encoded request body. -> See [create a container](docker_remote_api_v1.23.md#create-a-container) for details. +> See [create a container](#create-a-container) for details. **Example request**: @@ -1237,9 +1233,7 @@ Attach to the container `id` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1269,7 +1263,7 @@ Attach to the container `id` When using the TTY setting is enabled in [`POST /containers/create` -](docker_remote_api_v1.23.md#create-a-container), +](#create-a-container), the stream is the raw data from the process PTY and client's `stdin`. When the TTY is disabled, then the stream is multiplexed to separate `stdout` and `stderr`. @@ -1323,9 +1317,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet **Example response** - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1423,9 +1415,7 @@ Copy files or folders of container `id` HTTP/1.1 200 OK Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -1471,9 +1461,7 @@ Get a tar archive of a resource in the filesystem of container `id`. Content-Type: application/x-tar X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= - {% raw %} {{ TAR STREAM }} - {% endraw %} On success, a response header `X-Docker-Container-Path-Stat` will be set to a base64-encoded JSON object containing some filesystem header information about @@ -1528,9 +1516,7 @@ Upload a tar archive to be extracted to a path in the filesystem of container PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1656,9 +1642,7 @@ Build an image from a Dockerfile POST /build HTTP/1.1 - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1681,6 +1665,10 @@ The archive may include any number of other files, which are accessible in the build context (See the [*ADD build command*](../../reference/builder.md#add)). +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + The build is canceled if the client drops the connection by quitting or being killed. @@ -2624,7 +2612,7 @@ If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image image (and its parents) are returned, but with the exclusion of the 'repositories' file in the tarball, as there were no image names referenced. -See the [image tarball format](docker_remote_api_v1.23.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2653,7 +2641,7 @@ For each value of the `names` parameter: if it is a specific name and tag (e.g. an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. -See the [image tarball format](docker_remote_api_v1.23.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2676,7 +2664,7 @@ See the [image tarball format](docker_remote_api_v1.23.md#image-tarball-format) `POST /images/load` Load a set of images and tags into a Docker repository. -See the [image tarball format](docker_remote_api_v1.23.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2700,15 +2688,15 @@ See the [image tarball format](docker_remote_api_v1.23.md#image-tarball-format) **Example response**: -If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress -details are suppressed, and only a confirmation message is returned as plain text -once the action completes. +If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress +details are suppressed, and only a confirmation message is returned once the +action completes. HTTP/1.1 200 OK - Content-Length: 29 - Content-Type: text/plain; charset=utf-8 + Content-Type: application/json + Transfer-Encoding: chunked - Loaded image: busybox:latest + {"stream":"Loaded image: busybox:latest\n"} **Query parameters**: @@ -2818,9 +2806,7 @@ interactive session with the `exec` command. HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream - {% raw %} {{ STREAM }} - {% endraw %} **JSON parameters**: diff --git a/engine/reference/api/docker_remote_api_v1.24.md b/engine/reference/api/docker_remote_api_v1.24.md index 58ffa383975..efd0e939cfc 100644 --- a/engine/reference/api/docker_remote_api_v1.24.md +++ b/engine/reference/api/docker_remote_api_v1.24.md @@ -1,13 +1,13 @@ ---- -description: API Documentation for Docker -keywords: -- API, Docker, rcli, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: -5 -title: Remote API v1.24 ---- + # Docker Remote API v1.24 @@ -798,9 +798,7 @@ Get `stdout` and `stderr` logs from the container ``id`` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -878,9 +876,7 @@ Export the contents of container `id` HTTP/1.1 200 OK Content-Type: application/octet-stream - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -1266,9 +1262,7 @@ Attach to the container `id` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1298,7 +1292,7 @@ Attach to the container `id` When using the TTY setting is enabled in [`POST /containers/create` -](docker_remote_api_v1.24.md#create-a-container), +](#create-a-container), the stream is the raw data from the process PTY and client's `stdin`. When the TTY is disabled, then the stream is multiplexed to separate `stdout` and `stderr`. @@ -1352,9 +1346,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet **Example response** - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1468,9 +1460,7 @@ Get a tar archive of a resource in the filesystem of container `id`. Content-Type: application/x-tar X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= - {% raw %} {{ TAR STREAM }} - {% endraw %} On success, a response header `X-Docker-Container-Path-Stat` will be set to a base64-encoded JSON object containing some filesystem header information about @@ -1525,9 +1515,7 @@ Upload a tar archive to be extracted to a path in the filesystem of container PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1655,9 +1643,7 @@ Build an image from a Dockerfile POST /build HTTP/1.1 - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1680,6 +1666,10 @@ The archive may include any number of other files, which are accessible in the build context (See the [*ADD build command*](../../reference/builder.md#add)). +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + The build is canceled if the client drops the connection by quitting or being killed. @@ -2636,7 +2626,7 @@ If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image image (and its parents) are returned, but with the exclusion of the 'repositories' file in the tarball, as there were no image names referenced. -See the [image tarball format](docker_remote_api_v1.24.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2665,7 +2655,7 @@ For each value of the `names` parameter: if it is a specific name and tag (e.g. an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. -See the [image tarball format](docker_remote_api_v1.24.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2688,7 +2678,7 @@ See the [image tarball format](docker_remote_api_v1.24.md#image-tarball-format) `POST /images/load` Load a set of images and tags into a Docker repository. -See the [image tarball format](docker_remote_api_v1.24.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2712,15 +2702,15 @@ See the [image tarball format](docker_remote_api_v1.24.md#image-tarball-format) **Example response**: -If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress -details are suppressed, and only a confirmation message is returned as plain text -once the action completes. +If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress +details are suppressed, and only a confirmation message is returned once the +action completes. HTTP/1.1 200 OK - Content-Length: 29 - Content-Type: text/plain; charset=utf-8 + Content-Type: application/json + Transfer-Encoding: chunked - Loaded image: busybox:latest + {"stream":"Loaded image: busybox:latest\n"} **Query parameters**: @@ -2830,9 +2820,7 @@ interactive session with the `exec` command. HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream - {% raw %} {{ STREAM }} - {% endraw %} **JSON parameters**: @@ -3013,7 +3001,7 @@ Create a volume **JSON fields in response**: -Refer to the [inspect a volume](docker_remote_api_v1.24.md#inspect-a-volume) section or details about the +Refer to the [inspect a volume](#inspect-a-volume) section or details about the JSON fields returned in the response. ### Inspect a volume @@ -3208,7 +3196,7 @@ Content-Type: application/json "Config": [ { "Subnet": "172.19.0.0/16", - "Gateway": "172.19.0.1/16" + "Gateway": "172.19.0.1" } ], "Options": { @@ -3552,7 +3540,7 @@ Content-Type: application/json `POST /plugins/pull?name=` Pulls and installs a plugin. After the plugin is installed, it can be enabled -using the [`POST /plugins/(plugin name)/enable` endpoint](docker_remote_api_v1.24.md#enable-a-plugin). +using the [`POST /plugins/(plugin name)/enable` endpoint](#enable-a-plugin). **Example request**: @@ -3563,7 +3551,7 @@ POST /plugins/pull?name=tiborvass/no-remove:latest HTTP/1.1 The `:latest` tag is optional, and is used as default if omitted. When using this endpoint to pull a plugin from the registry, the `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. Refer to the [create -an image](docker_remote_api_v1.24.md#create-an-image) section for more details. +an image](#create-an-image) section for more details. **Example response**: @@ -3843,7 +3831,7 @@ POST /plugins/tiborvass/no-remove:latest HTTP/1.1 The `:latest` tag is optional, and is used as default if omitted. When using this endpoint to push a plugin to the registry, the `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. Refer to the [create -an image](docker_remote_api_v1.24.md#create-an-image) section for more details. +an image](#create-an-image) section for more details. **Example response**: @@ -4505,7 +4493,7 @@ List services Create a service. When using this endpoint to create a service using a private repository from the registry, the `X-Registry-Auth` header must be used to include a base64-encoded AuthConfig object. Refer to the [create an -image](docker_remote_api_v1.24.md#create-an-image) section for more details. +image](#create-an-image) section for more details. **Example request**: @@ -4667,7 +4655,7 @@ image](docker_remote_api_v1.24.md#create-an-image) section for more details. - **Content-type** – Set to `"application/json"`. - **X-Registry-Auth** – base64-encoded AuthConfig object, containing either - login information, or a token. Refer to the [create an image](docker_remote_api_v1.24.md#create-an-image) + login information, or a token. Refer to the [create an image](#create-an-image) section for more details. @@ -4684,7 +4672,9 @@ Stop and remove the service `id` **Example response**: - HTTP/1.1 200 No Content + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 **Status codes**: @@ -4789,7 +4779,7 @@ Update a service. When using this endpoint to create a service using a private repository from the registry, the `X-Registry-Auth` header can be used to update the authentication information for that is stored for the service. The header contains a base64-encoded AuthConfig object. Refer to the [create an -image](docker_remote_api_v1.24.md#create-an-image) section for more details. +image](#create-an-image) section for more details. **Example request**: @@ -4905,7 +4895,7 @@ image](docker_remote_api_v1.24.md#create-an-image) section for more details. - **Content-type** – Set to `"application/json"`. - **X-Registry-Auth** – base64-encoded AuthConfig object, containing either - login information, or a token. Refer to the [create an image](docker_remote_api_v1.24.md#create-an-image) + login information, or a token. Refer to the [create an image](#create-an-image) section for more details. **Status codes**: @@ -5107,7 +5097,7 @@ List tasks - `id=` - `name=` - `service=` - - `node=` + - `node=` - `label=key` or `label="key=value"` - `desired-state=(running | shutdown | accepted)` diff --git a/engine/reference/api/docker_remote_api_v1.25.md b/engine/reference/api/docker_remote_api_v1.25.md index ec2ec480f62..232f7839ce3 100644 --- a/engine/reference/api/docker_remote_api_v1.25.md +++ b/engine/reference/api/docker_remote_api_v1.25.md @@ -1,14 +1,13 @@ ---- -description: API Documentation for Docker -draft: true -keywords: -- API, Docker, rcli, REST, documentation -menu: - main: - parent: engine_remoteapi - weight: -6 -title: Remote API v1.25 ---- + # Docker Remote API v1.25 @@ -227,9 +226,12 @@ List containers sizes - **filters** - a JSON encoded value of the filters (a `map[string][]string`) to process on the containers list. Available filters: - `exited=`; -- containers with exit code of `` ; - - `status=`(`created`|`restarting`|`running`|`paused`|`exited`|`dead`) + - `status=`(`created`|`restarting`|`running`|`removing`|`paused`|`exited`|`dead`) - `label=key` or `label="key=value"` of a container label - `isolation=`(`default`|`process`|`hyperv`) (Windows daemon only) + `id=` a container's ID + `name=` a container's name + `is-task=`(`true`|`false`) - `ancestor`=(`[:]`, `` or ``) - `before`=(`` or ``) - `since`=(`` or ``) @@ -336,7 +338,8 @@ Create a container "StorageOpt": {}, "CgroupParent": "", "VolumeDriver": "", - "ShmSize": 67108864 + "ShmSize": 67108864, + "Mounts": [] }, "NetworkingConfig": { "EndpointsConfig": { @@ -495,6 +498,24 @@ Create a container - **CgroupParent** - Path to `cgroups` under which the container's `cgroup` is created. If the path is not absolute, the path is considered to be relative to the `cgroups` path of the init process. Cgroups are created if they do not already exist. - **VolumeDriver** - Driver that this container users to mount volumes. - **ShmSize** - Size of `/dev/shm` in bytes. The size must be greater than 0. If omitted the system uses 64MB. + - **Mounts** – Specification for mounts to be added to the container. + - **Target** – Container path. + - **Source** – Mount source (e.g. a volume name, a host path). + - **Type** – The mount type (`bind`, or `volume`). + Available types (for the `Type` field): + - **bind** - Mounts a file or directory from the host into the container. Must exist prior to creating the container. + - **volume** - Creates a volume with the given name and options (or uses a pre-existing volume with the same name and options). These are **not** removed when the container is removed. + - **ReadOnly** – A boolean indicating whether the mount should be read-only. + - **BindOptions** - Optional configuration for the `bind` type. + - **Propagation** – A propagation mode with the value `[r]private`, `[r]shared`, or `[r]slave`. + - **VolumeOptions** – Optional configuration for the `volume` type. + - **NoCopy** – A boolean indicating if volume should be + populated with the data from the target. (Default false) + - **Labels** – User-defined name and labels for the volume as key/value pairs: `{"name": "value"}` + - **DriverConfig** – Map of driver-specific options. + - **Name** - Name of the driver to use to create the volume. + - **Options** - key/value map of driver specific options. + **Query parameters**: @@ -624,7 +645,8 @@ Return low-level information on the container `id` "VolumesFrom": null, "Ulimits": [{}], "VolumeDriver": "", - "ShmSize": 67108864 + "ShmSize": 67108864, + "Mounts": [] }, "HostnamePath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hostname", "HostsPath": "/var/lib/docker/containers/ba033ac4401106a3b513bc9d639eee123ad78ca3616b921167cd74b20e25ed39/hosts", @@ -805,9 +827,7 @@ Get `stdout` and `stderr` logs from the container ``id`` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -885,9 +905,7 @@ Export the contents of container `id` HTTP/1.1 200 OK Content-Type: application/octet-stream - {% raw %} {{ TAR STREAM }} - {% endraw %} **Status codes**: @@ -1273,9 +1291,7 @@ Attach to the container `id` Connection: Upgrade Upgrade: tcp - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1305,7 +1321,7 @@ Attach to the container `id` When using the TTY setting is enabled in [`POST /containers/create` -](docker_remote_api_v1.25.md#create-a-container), +](#create-a-container), the stream is the raw data from the process PTY and client's `stdin`. When the TTY is disabled, then the stream is multiplexed to separate `stdout` and `stderr`. @@ -1359,9 +1375,7 @@ Implements websocket protocol handshake according to [RFC 6455](http://tools.iet **Example response** - {% raw %} {{ STREAM }} - {% endraw %} **Query parameters**: @@ -1475,9 +1489,7 @@ Get a tar archive of a resource in the filesystem of container `id`. Content-Type: application/x-tar X-Docker-Container-Path-Stat: eyJuYW1lIjoicm9vdCIsInNpemUiOjQwOTYsIm1vZGUiOjIxNDc0ODQwOTYsIm10aW1lIjoiMjAxNC0wMi0yN1QyMDo1MToyM1oiLCJsaW5rVGFyZ2V0IjoiIn0= - {% raw %} {{ TAR STREAM }} - {% endraw %} On success, a response header `X-Docker-Container-Path-Stat` will be set to a base64-encoded JSON object containing some filesystem header information about @@ -1532,9 +1544,7 @@ Upload a tar archive to be extracted to a path in the filesystem of container PUT /containers/8cce319429b2/archive?path=/vol1 HTTP/1.1 Content-Type: application/x-tar - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1557,6 +1567,38 @@ Upload a tar archive to be extracted to a path in the filesystem of container - no such file or directory (**path** resource does not exist) - **500** – server error + +### Prune stopped containers + +`POST /containers/prune` + +Delete stopped containers + +**Example request**: + + POST /containers/prune HTTP/1.1 + Content-Type: application/json + + { + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ContainersDeleted": [ + "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148" + ], + "SpaceReclaimed": 109 + } + +**Status codes**: + +- **200** – no error +- **500** – server error + ## 3.2 Images ### List Images @@ -1662,9 +1704,7 @@ Build an image from a Dockerfile POST /build HTTP/1.1 - {% raw %} {{ TAR STREAM }} - {% endraw %} **Example response**: @@ -1687,6 +1727,10 @@ The archive may include any number of other files, which are accessible in the build context (See the [*ADD build command*](../../reference/builder.md#add)). +The Docker daemon performs a preliminary validation of the `Dockerfile` before +starting the build, and returns an error if the syntax is incorrect. After that, +each instruction is run one-by-one until the ID of the new image is output. + The build is canceled if the client drops the connection by quitting or being killed. @@ -1706,6 +1750,7 @@ or being killed. there must be a file with the corresponding path inside the tarball. - **q** – Suppress verbose build output. - **nocache** – Do not use the cache when building the image. +- **cachefrom** - JSON array of images used for build cache resolution. - **pull** - Attempt to pull the image even if an older image exists locally. - **rm** - Remove intermediate containers after a successful build (default behavior). - **forcerm** - Always remove intermediate containers (includes `rm`). @@ -1839,7 +1884,7 @@ Return low-level information on the image `name` GET /images/example/json HTTP/1.1 -**Example response**: +**Example response (Linux daemon)**: HTTP/1.1 200 OK Content-Type: application/json @@ -1941,6 +1986,86 @@ Return low-level information on the image `name` } } +**Example response (Windows daemon)**: + + HTTP/1.1 200 OK + Content-Type: application/json + + [ + { + "Id": "sha256:105d76d0f40e38427c63023ffe649bf36fa85058d3469551e43e4dcc2431fb31", + "RepoTags": [ + "microsoft/nanoserver:latest" + ], + "RepoDigests": [ + "microsoft/nanoserver@sha256:aee7d4330fe3dc5987c808f647441c16ed2fa1c7d9c6ef49d6498e5c9860b50b" + ], + "Parent": "", + "Comment": "", + "Created": "2016-09-22T02:39:30.9154862-07:00", + "Container": "", + "ContainerConfig": { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": null, + "Image": "", + "Volumes": null, + "WorkingDir": "", + "Entrypoint": null, + "OnBuild": null, + "Labels": null + }, + "DockerVersion": "", + "Author": "", + "Config": { + "Hostname": "", + "Domainname": "", + "User": "", + "AttachStdin": false, + "AttachStdout": false, + "AttachStderr": false, + "Tty": false, + "OpenStdin": false, + "StdinOnce": false, + "Env": null, + "Cmd": [ + "c:\\windows\\system32\\cmd.exe" + ], + "Image": "", + "Volumes": null, + "WorkingDir": "", + "Entrypoint": null, + "OnBuild": null, + "Labels": null + }, + "Architecture": "", + "Os": "windows", + "OsVersion": "10.0.14393", + "Size": 651862727, + "VirtualSize": 651862727, + "GraphDriver": { + "Name": "windowsfilter", + "Data": { + "dir": "C:\\control\\windowsfilter\\6fe6a289b98276a6a5ca0345156ca61d7b38f3da6bb49ef95af1d0f1ac37e5bf" + } + }, + "RootFS": { + "Type": "layers", + "Layers": [ + "sha256:342d4e407550c52261edd20cd901b5ce438f0b1e940336de3978210612365063" + ] + } + } + ] + **Status codes**: - **200** – no error @@ -2181,6 +2306,54 @@ Search for an image on [Docker Hub](https://hub.docker.com). - **200** – no error - **500** – server error +### Prune unused images + +`POST /images/prune` + +Delete unused images + +**Example request**: + + POST /images/prune HTTP/1.1 + Content-Type: application/json + + { + "DanglingOnly": false + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ImagesDeleted": [ + { + "Untagged": "busybox:latest" + }, + { + "Untagged": "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + }, + { + "Deleted": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749" + }, + { + "Deleted": "sha256:8ac8bfaff55af948c796026ee867448c5b5b5d9dd3549f4006d9759b25d4a893" + } + ], + "SpaceReclaimed": 1092588 + } + +**JSON parameters**: + +- **DanglingOnly**: if `true` only delete unused *and* untagged images. Default to `false` if omitted + +**Status codes**: + +- **200** – no error +- **500** – server error + + ## 3.3 Misc ### Check auth configuration @@ -2226,7 +2399,7 @@ Display system-wide information GET /info HTTP/1.1 -**Example response**: +**Example response (Linux)**: HTTP/1.1 200 OK Content-Type: application/json @@ -2304,6 +2477,198 @@ Display system-wide information "SystemTime": "2015-03-10T11:11:23.730591467-07:00" } + +**Example response (Windows)**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "ID": "NYMS:B5VK:UMSL:FVDZ:EWB5:FKVK:LPFL:FJMQ:H6FT:BZJ6:L2TD:XH62", + "Containers": 1, + "ContainersRunning": 0, + "ContainersPaused": 0, + "ContainersStopped": 1, + "Images": 17, + "Driver": "windowsfilter", + "DriverStatus": [ + ["Windows", ""] + ], + "SystemStatus": null, + "Plugins": { + "Volume": ["local"], + "Network": ["nat", "null", "overlay"], + "Authorization": null + }, + "MemoryLimit": false, + "SwapLimit": false, + "KernelMemory": false, + "CpuCfsPeriod": false, + "CpuCfsQuota": false, + "CPUShares": false, + "CPUSet": false, + "IPv4Forwarding": true, + "BridgeNfIptables": true, + "BridgeNfIp6tables": true, + "Debug": false, + "NFd": -1, + "OomKillDisable": false, + "NGoroutines": 11, + "SystemTime": "2016-09-23T11:59:58.9843533-07:00", + "LoggingDriver": "json-file", + "CgroupDriver": "", + "NEventsListener": 0, + "KernelVersion": "10.0 14393 (14393.206.amd64fre.rs1_release.160912-1937)", + "OperatingSystem": "Windows Server 2016 Datacenter", + "OSType": "windows", + "Architecture": "x86_64", + "IndexServerAddress": "https://index.docker.io/v1/", + "RegistryConfig": { + "InsecureRegistryCIDRs": ["127.0.0.0/8"], + "IndexConfigs": { + "docker.io": { + "Name": "docker.io", + "Mirrors": null, + "Secure": true, + "Official": true + } + }, + "Mirrors": null + }, + "NCPU": 8, + "MemTotal": 4293828608, + "DockerRootDir": "C:\\control", + "HttpProxy": "", + "HttpsProxy": "", + "NoProxy": "", + "Name": "WIN-V0V70C0LU5P", + "Labels": null, + "ExperimentalBuild": false, + "ServerVersion": "1.13.0-dev", + "ClusterStore": "", + "ClusterAdvertise": "", + "SecurityOptions": null, + "Runtimes": null, + "DefaultRuntime": "", + "Swarm": { + "NodeID": "", + "NodeAddr": "", + "LocalNodeState": "inactive", + "ControlAvailable": false, + "Error": "", + "RemoteManagers": null, + "Nodes": 0, + "Managers": 0, + "Cluster": { + "ID": "", + "Version": {}, + "CreatedAt": "0001-01-01T00:00:00Z", + "UpdatedAt": "0001-01-01T00:00:00Z", + "Spec": { + "Orchestration": {}, + "Raft": { + "ElectionTick": 0, + "HeartbeatTick": 0 + }, + "Dispatcher": {}, + "CAConfig": {}, + "TaskDefaults": {} + } + } + }, + "LiveRestoreEnabled": false, + "Isolation": "process" + } + +**Status codes**: + +- **200** – no error +- **500** – server error + +### Show docker data usage information + +`GET /system/df` + +Return docker data usage information + +**Example request**: + + GET /system/df HTTP/1.1 + +**Example response**: + + { + "LayersSize": 1092588, + "Images": [ + { + "Id": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "ParentId": "", + "RepoTags": [ + "busybox:latest" + ], + "RepoDigests": [ + "busybox@sha256:a59906e33509d14c036c8678d687bd4eec81ed7c4b8ce907b888c607f6a1e0e6" + ], + "Created": 1466724217, + "Size": 1092588, + "SharedSize": 0, + "VirtualSize": 1092588, + "Labels": {}, + "Containers": 1 + } + ], + "Containers": [ + { + "Id": "e575172ed11dc01bfce087fb27bee502db149e1a0fad7c296ad300bbff178148", + "Names": [ + "/top" + ], + "Image": "busybox", + "ImageID": "sha256:2b8fd9751c4c0f5dd266fcae00707e67a2545ef34f9a29354585f93dac906749", + "Command": "top", + "Created": 1472592424, + "Ports": [], + "SizeRootFs": 1092588, + "Labels": {}, + "State": "exited", + "Status": "Exited (0) 56 minutes ago", + "HostConfig": { + "NetworkMode": "default" + }, + "NetworkSettings": { + "Networks": { + "bridge": { + "IPAMConfig": null, + "Links": null, + "Aliases": null, + "NetworkID": "d687bc59335f0e5c9ee8193e5612e8aee000c8c62ea170cfb99c098f95899d92", + "EndpointID": "8ed5115aeaad9abb174f68dcf135b49f11daf597678315231a32ca28441dec6a", + "Gateway": "172.18.0.1", + "IPAddress": "172.18.0.2", + "IPPrefixLen": 16, + "IPv6Gateway": "", + "GlobalIPv6Address": "", + "GlobalIPv6PrefixLen": 0, + "MacAddress": "02:42:ac:12:00:02" + } + } + }, + "Mounts": [] + } + ], + "Volumes": [ + { + "Name": "my-volume", + "Driver": "local", + "Mountpoint": "", + "Labels": null, + "Scope": "", + "Size": 0, + "RefCount": 0 + } + ] + } + **Status codes**: - **200** – no error @@ -2652,7 +3017,7 @@ If `name` is a specific name and tag (e.g. ubuntu:latest), then only that image image (and its parents) are returned, but with the exclusion of the 'repositories' file in the tarball, as there were no image names referenced. -See the [image tarball format](docker_remote_api_v1.25.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2681,7 +3046,7 @@ For each value of the `names` parameter: if it is a specific name and tag (e.g. an image ID, similarly only that image (and its parents) are returned and there would be no names referenced in the 'repositories' file for this image ID. -See the [image tarball format](docker_remote_api_v1.25.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2704,7 +3069,7 @@ See the [image tarball format](docker_remote_api_v1.25.md#image-tarball-format) `POST /images/load` Load a set of images and tags into a Docker repository. -See the [image tarball format](docker_remote_api_v1.25.md#image-tarball-format) for more details. +See the [image tarball format](#image-tarball-format) for more details. **Example request** @@ -2728,7 +3093,7 @@ See the [image tarball format](docker_remote_api_v1.25.md#image-tarball-format) **Example response**: -If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress +If the "quiet" query parameter is set to `true` / `1` (`?quiet=1`), progress details are suppressed, and only a confirmation message is returned once the action completes. @@ -2846,9 +3211,7 @@ interactive session with the `exec` command. HTTP/1.1 200 OK Content-Type: application/vnd.docker.raw-stream - {% raw %} {{ STREAM }} - {% endraw %} **JSON parameters**: @@ -3032,7 +3395,7 @@ Create a volume **JSON fields in response**: -Refer to the [inspect a volume](docker_remote_api_v1.25.md#inspect-a-volume) section or details about the +Refer to the [inspect a volume](#inspect-a-volume) section or details about the JSON fields returned in the response. ### Inspect a volume @@ -3101,6 +3464,11 @@ Instruct the driver to remove the volume (`name`). HTTP/1.1 204 No Content +**Query Parameters**: + +- **force** - 1/True/true or 0/False/false, Force the removal of the volume. + Default `false`. + **Status codes**: - **204** - no error @@ -3108,6 +3476,38 @@ Instruct the driver to remove the volume (`name`). - **409** - volume is in use and cannot be removed - **500** - server error +### Prune unused volumes + +`POST /volumes/prune` + +Delete unused volumes + +**Example request**: + + POST /volumes/prune HTTP/1.1 + Content-Type: application/json + + { + } + +**Example response**: + + HTTP/1.1 200 OK + Content-Type: application/json + + { + "VolumesDeleted": [ + "my-volume" + ], + "SpaceReclaimed": 42 + } + +**Status codes**: + +- **200** – no error +- **500** – server error + + ## 3.5 Networks ### List networks @@ -3571,7 +3971,7 @@ Content-Type: application/json `POST /plugins/pull?name=` Pulls and installs a plugin. After the plugin is installed, it can be enabled -using the [`POST /plugins/(plugin name)/enable` endpoint](docker_remote_api_v1.25.md#enable-a-plugin). +using the [`POST /plugins/(plugin name)/enable` endpoint](#enable-a-plugin). **Example request**: @@ -3582,7 +3982,7 @@ POST /plugins/pull?name=tiborvass/no-remove:latest HTTP/1.1 The `:latest` tag is optional, and is used as default if omitted. When using this endpoint to pull a plugin from the registry, the `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. Refer to the [create -an image](docker_remote_api_v1.25.md#create-an-image) section for more details. +an image](#create-an-image) section for more details. **Example response**: @@ -3879,7 +4279,7 @@ POST /plugins/tiborvass/no-remove:latest HTTP/1.1 The `:latest` tag is optional, and is used as default if omitted. When using this endpoint to push a plugin to the registry, the `X-Registry-Auth` header can be used to include a base64-encoded AuthConfig object. Refer to the [create -an image](docker_remote_api_v1.25.md#create-an-image) section for more details. +an image](#create-an-image) section for more details. **Example response**: @@ -4541,7 +4941,7 @@ List services Create a service. When using this endpoint to create a service using a private repository from the registry, the `X-Registry-Auth` header must be used to include a base64-encoded AuthConfig object. Refer to the [create an -image](docker_remote_api_v1.25.md#create-an-image) section for more details. +image](#create-an-image) section for more details. **Example request**: @@ -4703,7 +5103,7 @@ image](docker_remote_api_v1.25.md#create-an-image) section for more details. - **Content-type** – Set to `"application/json"`. - **X-Registry-Auth** – base64-encoded AuthConfig object, containing either - login information, or a token. Refer to the [create an image](docker_remote_api_v1.25.md#create-an-image) + login information, or a token. Refer to the [create an image](#create-an-image) section for more details. @@ -4720,7 +5120,9 @@ Stop and remove the service `id` **Example response**: - HTTP/1.1 200 No Content + HTTP/1.1 200 OK + Content-Length: 0 + Content-Type: text/plain; charset=utf-8 **Status codes**: @@ -4825,7 +5227,7 @@ Update a service. When using this endpoint to create a service using a private repository from the registry, the `X-Registry-Auth` header can be used to update the authentication information for that is stored for the service. The header contains a base64-encoded AuthConfig object. Refer to the [create an -image](docker_remote_api_v1.25.md#create-an-image) section for more details. +image](#create-an-image) section for more details. **Example request**: @@ -4941,7 +5343,7 @@ image](docker_remote_api_v1.25.md#create-an-image) section for more details. - **Content-type** – Set to `"application/json"`. - **X-Registry-Auth** – base64-encoded AuthConfig object, containing either - login information, or a token. Refer to the [create an image](docker_remote_api_v1.25.md#create-an-image) + login information, or a token. Refer to the [create an image](#create-an-image) section for more details. **Status codes**: @@ -5143,7 +5545,7 @@ List tasks - `id=` - `name=` - `service=` - - `node=` + - `node=` - `label=key` or `label="key=value"` - `desired-state=(running | shutdown | accepted)` diff --git a/engine/reference/api/hub_registry_spec.md b/engine/reference/api/hub_registry_spec.md index d19001e6d58..87c4c884826 100644 --- a/engine/reference/api/hub_registry_spec.md +++ b/engine/reference/api/hub_registry_spec.md @@ -1,13 +1,13 @@ ---- -description: Documentation for docker Registry and Registry API -draft: true -keywords: -- docker, registry, api, hub -menu: - main: - parent: smn_hub_ref -title: The Docker Hub and the Registry v1 ---- + # The Docker Hub and the Registry v1 diff --git a/engine/reference/api/index.md b/engine/reference/api/index.md index 0837213032a..05f3d126f23 100644 --- a/engine/reference/api/index.md +++ b/engine/reference/api/index.md @@ -1,13 +1,14 @@ ---- -description: Reference -keywords: -- Engine -menu: - main: - identifier: engine_remoteapi - parent: engine_ref -title: API Reference ---- + + # API Reference diff --git a/engine/reference/api/remote_api_client_libraries.md b/engine/reference/api/remote_api_client_libraries.md index 82a0d40957f..4b7f4327e66 100644 --- a/engine/reference/api/remote_api_client_libraries.md +++ b/engine/reference/api/remote_api_client_libraries.md @@ -1,14 +1,13 @@ ---- -description: Various client libraries available to use with the Docker remote API -keywords: -- API, Docker, index, registry, REST, documentation, clients, C#, Erlang, Go, Groovy, - Java, JavaScript, Perl, PHP, Python, Ruby, Rust, Scala -menu: - main: - parent: engine_remoteapi - weight: 90 -title: Remote API client libraries ---- + # Docker Remote API client libraries @@ -51,11 +50,6 @@ with the library maintainers. bwu_docker https://github.com/bwu-dart/bwu_docker - - Go - engine-api - https://github.com/docker/engine-api - Gradle gradle-docker-plugin diff --git a/engine/reference/builder.md b/engine/reference/builder.md index ba86306c016..bef2b855358 100644 --- a/engine/reference/builder.md +++ b/engine/reference/builder.md @@ -1,16 +1,13 @@ ---- -aliases: - - /reference/builder/ -description: Dockerfiles use a simple DSL which allows you to automate the steps you - would normally manually take to create an image. -keywords: -- builder, docker, Dockerfile, automation, image creation -menu: - main: - parent: engine_ref - weight: -90 -title: Dockerfile reference ---- + # Dockerfile reference @@ -53,7 +50,7 @@ To use a file in the build context, the `Dockerfile` refers to the file specifie in an instruction, for example, a `COPY` instruction. To increase the build's performance, exclude files and directories by adding a `.dockerignore` file to the context directory. For information about how to [create a `.dockerignore` -file](builder.md#dockerignore-file) see the documentation on this page. +file](#dockerignore-file) see the documentation on this page. Traditionally, the `Dockerfile` is called `Dockerfile` and located in the root of the context. You use the `-f` flag with `docker build` to point to a Dockerfile @@ -71,6 +68,13 @@ add multiple `-t` parameters when you run the `build` command: $ docker build -t shykes/myapp:1.0.2 -t shykes/myapp:latest . +Before the Docker daemon runs the instructions in the `Dockerfile`, it performs +a preliminary validation of the `Dockerfile` and returns an error if the syntax is incorrect: + + $ docker build -t test/myapp . + Sending build context to Docker daemon 2.048 kB + Error response from daemon: Unknown instruction: RUNCMD + The Docker daemon runs the instructions in the `Dockerfile` one-by-one, committing the result of each instruction to a new image if necessary, before finally outputting the ID of your @@ -102,6 +106,13 @@ the `Using cache` message in the console output. ---> 7ea8aef582cc Successfully built 7ea8aef582cc +Build cache is only used from images that have a local parent chain. This means +that these images were created by previous builds or the whole chain of images +was loaded with `docker load`. If you wish to use build cache of a specific +image you can specify it with `--cache-from` option. Images specified with +`--cache-from` do not need to have a parent chain and may be pulled from other +registries. + When you're done with your build, you're ready to look into [*Pushing a repository to its registry*](../tutorials/dockerrepos.md#contributing-to-docker-hub). @@ -301,7 +312,7 @@ Results in: ## Environment replacement -Environment variables (declared with [the `ENV` statement](builder.md#env)) can also be +Environment variables (declared with [the `ENV` statement](#env)) can also be used in certain instructions as variables to be interpreted by the `Dockerfile`. Escapes are also handled for including variable-like syntax into a statement literally. @@ -489,13 +500,6 @@ before each new `FROM` command. assumes a `latest` by default. The builder returns an error if it cannot match the `tag` value. -## MAINTAINER - - MAINTAINER - -The `MAINTAINER` instruction allows you to set the *Author* field of the -generated images. - ## RUN RUN has 2 forms: @@ -505,7 +509,7 @@ default is `/bin/sh -c` on Linux or `cmd /S /C` on Windows) - `RUN ["executable", "param1", "param2"]` (*exec* form) The `RUN` instruction will execute any commands in a new layer on top of the -current image and commit the results. The resulting committed image will be +current image and commit the results. The resulting comitted image will be used for the next step in the `Dockerfile`. Layering `RUN` instructions and generating commits conforms to the core @@ -567,7 +571,7 @@ See the [`Dockerfile` Best Practices guide](../userguide/eng-image/dockerfile_best-practices.md#build-cache) for more information. The cache for `RUN` instructions can be invalidated by `ADD` instructions. See -[below](builder.md#add) for details. +[below](#add) for details. ### Known issues (RUN) @@ -636,7 +640,7 @@ must be individually expressed as strings in the array: If you would like your container to run the same executable every time, then you should consider using `ENTRYPOINT` in combination with `CMD`. See -[*ENTRYPOINT*](builder.md#entrypoint). +[*ENTRYPOINT*](#entrypoint). If the user specifies arguments to `docker run` then they will override the default specified in `CMD`. @@ -690,6 +694,20 @@ To view an image's labels, use the `docker inspect` command. "other": "value3" }, +## MAINTAINER (deprecated) + + MAINTAINER + +The `MAINTAINER` instruction sets the *Author* field of the generated images. +The `LABEL` instruction is a much more flexible version of this and you should use +it instead, as it enables setting any metadata you require, and can be viewed +easily, for example with `docker inspect`. To set a label corresponding to the +`MAINTAINER` field you could use: + + LABEL maintainer "SvenDowideit@home.org.au" + +This will then be visible from `docker inspect` with the other labels. + ## EXPOSE EXPOSE [...] @@ -714,7 +732,7 @@ feature](../userguide/networking/index.md)). The `ENV` instruction sets the environment variable `` to the value ``. This value will be in the environment of all "descendant" -`Dockerfile` commands and can be [replaced inline](builder.md#environment-replacement) in +`Dockerfile` commands and can be [replaced inline](#environment-replacement) in many as well. The `ENV` instruction has two forms. The first form, `ENV `, @@ -1164,12 +1182,12 @@ or for executing an ad-hoc command in a container. The table below shows what command is executed for different `ENTRYPOINT` / `CMD` combinations: -| | No ENTRYPOINT | ENTRYPOINT exec_entry p1_entry | ENTRYPOINT ["exec_entry", "p1_entry"] | -|--------------------------------|----------------------------|-----------------------------------------------------------|------------------------------------------------| -| **No CMD** | *error, not allowed* | /bin/sh -c exec_entry p1_entry | exec_entry p1_entry | -| **CMD ["exec_cmd", "p1_cmd"]** | exec_cmd p1_cmd | /bin/sh -c exec_entry p1_entry exec_cmd p1_cmd | exec_entry p1_entry exec_cmd p1_cmd | -| **CMD ["p1_cmd", "p2_cmd"]** | p1_cmd p2_cmd | /bin/sh -c exec_entry p1_entry p1_cmd p2_cmd | exec_entry p1_entry p1_cmd p2_cmd | -| **CMD exec_cmd p1_cmd** | /bin/sh -c exec_cmd p1_cmd | /bin/sh -c exec_entry p1_entry /bin/sh -c exec_cmd p1_cmd | exec_entry p1_entry /bin/sh -c exec_cmd p1_cmd | +| | No ENTRYPOINT | ENTRYPOINT exec_entry p1_entry | ENTRYPOINT ["exec_entry", "p1_entry"] | +|--------------------------------|----------------------------|--------------------------------|------------------------------------------------| +| **No CMD** | *error, not allowed* | /bin/sh -c exec_entry p1_entry | exec_entry p1_entry | +| **CMD ["exec_cmd", "p1_cmd"]** | exec_cmd p1_cmd | /bin/sh -c exec_entry p1_entry | exec_entry p1_entry exec_cmd p1_cmd | +| **CMD ["p1_cmd", "p2_cmd"]** | p1_cmd p2_cmd | /bin/sh -c exec_entry p1_entry | exec_entry p1_entry p1_cmd p2_cmd | +| **CMD exec_cmd p1_cmd** | /bin/sh -c exec_cmd p1_cmd | /bin/sh -c exec_entry p1_entry | exec_entry p1_entry /bin/sh -c exec_cmd p1_cmd | ## VOLUME @@ -1250,9 +1268,9 @@ The output of the final `pwd` command in this `Dockerfile` would be ARG [=] The `ARG` instruction defines a variable that users can pass at build-time to -the builder with the `docker build` command using the -`--build-arg =` flag. If a user specifies a build argument -that was not defined in the Dockerfile, the build outputs an error. +the builder with the `docker build` command using the `--build-arg +=` flag. If a user specifies a build argument that was not +defined in the Dockerfile, the build outputs an error. ``` One or more build-args were not consumed, failing build. @@ -1351,7 +1369,7 @@ its value would be `v1.0.0` as it is the default set in line 3 by the `ENV` inst The variable expansion technique in this example allows you to pass arguments from the command line and persist them in the final image by leveraging the `ENV` instruction. Variable expansion is only supported for [a limited set of -Dockerfile instructions.](builder.md#environment-replacement) +Dockerfile instructions.](#environment-replacement) Docker has a set of predefined `ARG` variables that you can use without a corresponding `ARG` instruction in the Dockerfile. @@ -1365,11 +1383,8 @@ corresponding `ARG` instruction in the Dockerfile. * `NO_PROXY` * `no_proxy` -To use these, simply pass them on the command line using the flag: - -``` ---build-arg = -``` +To use these, simply pass them on the command line using the `--build-arg +=` flag. ### Impact on build caching @@ -1682,8 +1697,6 @@ something more realistic, take a look at the list of [Dockerization examples](.. # VERSION 0.0.1 FROM ubuntu -MAINTAINER Victor Vieux - LABEL Description="This image is used to start the foobar executable" Vendor="ACME Products" Version="1.0" RUN apt-get update && apt-get install -y inotify-tools nginx apache2 openssh-server ``` diff --git a/engine/reference/commandline/attach.md b/engine/reference/commandline/attach.md index 3939806a38c..d0b519840bd 100644 --- a/engine/reference/commandline/attach.md +++ b/engine/reference/commandline/attach.md @@ -1,12 +1,12 @@ ---- -description: The attach command description and usage -keywords: -- attach, running, container -menu: - main: - parent: smn_cli -title: attach ---- + # attach diff --git a/engine/reference/commandline/build.md b/engine/reference/commandline/build.md index 9cb390b91c8..65f54cc81f3 100644 --- a/engine/reference/commandline/build.md +++ b/engine/reference/commandline/build.md @@ -1,12 +1,12 @@ ---- -description: The build command description and usage -keywords: -- build, docker, image -menu: - main: - parent: smn_cli -title: build ---- + # build @@ -17,7 +17,9 @@ Build an image from a Dockerfile Options: --build-arg value Set build-time variables (default []) + --cache-from value Images to consider as cache sources (default []) --cgroup-parent string Optional parent cgroup for the container + --compress Compress the build context using gzip --cpu-period int Limit the CPU CFS (Completely Fair Scheduler) period --cpu-quota int Limit the CPU CFS (Completely Fair Scheduler) quota -c, --cpu-shares int CPU shares (relative weight) @@ -35,6 +37,7 @@ Options: --pull Always attempt to pull a newer version of the image -q, --quiet Suppress the build output and print image ID on success --rm Remove intermediate containers after a successful build (default true) + --security-opt value Security Options (default []) --shm-size string Size of /dev/shm, default value is 64MB. The format is ``. `number` must be greater than `0`. Unit is optional and can be `b` (bytes), `k` (kilobytes), `m` (megabytes), @@ -395,6 +398,12 @@ 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 diff --git a/engine/reference/commandline/cli.md b/engine/reference/commandline/cli.md index b78f7aad524..51a8dd6abaa 100644 --- a/engine/reference/commandline/cli.md +++ b/engine/reference/commandline/cli.md @@ -1,13 +1,13 @@ ---- -description: Docker's CLI command description and usage -keywords: -- Docker, Docker documentation, CLI, command line -menu: - main: - parent: smn_cli - weight: -2 -title: Use the Docker command line ---- + # Use the Docker command line @@ -26,7 +26,7 @@ Options: --config=~/.docker Location of client config files -D, --debug Enable debug mode -H, --host=[] Daemon socket(s) to connect to - -h, --help Print usage + --help Print usage -l, --log-level=info Set the logging level --tls Use TLS; implied by --tlsverify --tlscacert=~/.docker/ca.pem Trust certs signed only by this CA @@ -143,18 +143,24 @@ Docker's client uses this property. If this property is not set, the client falls back to the default table format. For a list of supported formatting directives, see the [**Formatting** section in the `docker images` documentation](images.md) +The property `serviceInspectFormat` specifies the default format for `docker +service inspect` output. When the `--format` flag is not provided with the +`docker service inspect` command, Docker's client uses this property. If this +property is not set, the client falls back to the default json format. For a +list of supported formatting directives, see the +[**Formatting** section in the `docker service inspect` documentation](service_inspect.md) + Following is a sample `config.json` file: - {% raw %} { "HttpHeaders": { "MyHeader": "MyValue" }, "psFormat": "table {{.ID}}\\t{{.Image}}\\t{{.Command}}\\t{{.Labels}}", "imagesFormat": "table {{.ID}}\\t{{.Repository}}\\t{{.Tag}}\\t{{.CreatedAt}}", + "serviceInspectFormat": "pretty", "detachKeys": "ctrl-e,e" } - {% endraw %} ### Notary @@ -176,8 +182,9 @@ To list the help on any command just execute the command, followed by the Run a command in a new container - -a, --attach=[] Attach to STDIN, STDOUT or STDERR - --cpu-shares=0 CPU shares (relative weight) + Options: + --add-host value Add a custom host-to-IP mapping (host:ip) (default []) + -a, --attach value Attach to STDIN, STDOUT or STDERR (default []) ... ## Option types diff --git a/engine/reference/commandline/commit.md b/engine/reference/commandline/commit.md index 72b4422f983..acfb7c95be7 100644 --- a/engine/reference/commandline/commit.md +++ b/engine/reference/commandline/commit.md @@ -1,12 +1,12 @@ ---- -description: The commit command description and usage -keywords: -- commit, file, changes -menu: - main: - parent: smn_cli -title: commit ---- + # commit @@ -55,7 +55,6 @@ created. Supported `Dockerfile` instructions: ## Commit a container with new configurations - {% raw %} $ docker ps ID IMAGE COMMAND CREATED STATUS PORTS c3f279d17e0a ubuntu:12.04 /bin/bash 7 days ago Up 25 hours @@ -66,7 +65,6 @@ created. Supported `Dockerfile` instructions: 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 diff --git a/engine/reference/commandline/container_prune.md b/engine/reference/commandline/container_prune.md new file mode 100644 index 00000000000..2301353afa2 --- /dev/null +++ b/engine/reference/commandline/container_prune.md @@ -0,0 +1,41 @@ + + +# container prune + +```markdown +Usage: docker container prune [OPTIONS] + +Remove all stopped containers + +Options: + -f, --force Do not prompt for confirmation + --help Print usage +``` + +## Examples + +```bash +$ docker container prune +WARNING! This will remove all stopped containers. +Are you sure you want to continue? [y/N] y +Deleted Containers: +4a7f7eebae0f63178aff7eb0aa39cd3f0627a203ab2df258c1a00b456cf20063 +f98f9c2aa1eaf727e4ec9c0283bc7d4aa4762fbdba7f26191f26c97f64090360 + +Total reclaimed space: 212 B +``` + +## Related information + +* [system df](system_df.md) +* [volume prune](volume_prune.md) +* [image prune](image_prune.md) +* [system prune](system_prune.md) diff --git a/engine/reference/commandline/cp.md b/engine/reference/commandline/cp.md index e1b14b5aeb1..b3a0b789165 100644 --- a/engine/reference/commandline/cp.md +++ b/engine/reference/commandline/cp.md @@ -1,12 +1,12 @@ ---- -description: The cp command description and usage -keywords: -- copy, container, files, folders -menu: - main: - parent: smn_cli -title: cp ---- + # cp diff --git a/engine/reference/commandline/create.md b/engine/reference/commandline/create.md index a28788fbdca..9e3dfdead54 100644 --- a/engine/reference/commandline/create.md +++ b/engine/reference/commandline/create.md @@ -1,12 +1,12 @@ ---- -description: The create command description and usage -keywords: -- docker, create, container -menu: - main: - parent: smn_cli -title: create ---- + # create @@ -90,6 +90,7 @@ Options: --read-only Mount the container's root filesystem as read only --restart string Restart policy to apply when a container exits (default "no") Possible values are: no, on-failure[:max-retry], always, unless-stopped + --rm Automatically remove the container when it exits --runtime string Runtime to use for this container --security-opt value Security Options (default []) --shm-size string Size of /dev/shm, default value is 64MB. @@ -171,7 +172,7 @@ Set storage driver options per container. This (size) will allow to set the container rootfs size to 120G at creation time. User cannot pass a size less than the Default BaseFS Size. This option is only -available for the `devicemapper`, `btrfs`, and `zfs` graph drivers. +available for the `devicemapper`, `btrfs`, `windowsfilter`, and `zfs` graph drivers. ### Specify isolation technology for container (--isolation) diff --git a/engine/reference/commandline/deploy.md b/engine/reference/commandline/deploy.md index 8102e247dc3..908131e4bb4 100644 --- a/engine/reference/commandline/deploy.md +++ b/engine/reference/commandline/deploy.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: The deploy command description and usage -keywords: -- stack, deploy -menu: - main: - parent: smn_cli -title: deploy ---- + # stack deploy (experimental) diff --git a/engine/reference/commandline/diff.md b/engine/reference/commandline/diff.md index 789388f625c..8c01b8cdf2b 100644 --- a/engine/reference/commandline/diff.md +++ b/engine/reference/commandline/diff.md @@ -1,12 +1,12 @@ ---- -description: The diff command description and usage -keywords: -- list, changed, files, container -menu: - main: - parent: smn_cli -title: diff ---- + # diff diff --git a/engine/reference/commandline/dockerd.md b/engine/reference/commandline/dockerd.md index b2571380a01..d134f6e1023 100644 --- a/engine/reference/commandline/dockerd.md +++ b/engine/reference/commandline/dockerd.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/reference/commandline/daemon/ -description: The daemon command description and usage -keywords: -- container, daemon, runtime -menu: - main: - parent: smn_cli - weight: -1 -title: dockerd ---- + # daemon @@ -49,6 +48,8 @@ Options: -H, --host=[] Daemon socket(s) to connect to --help Print usage --icc=true Enable inter-container communication + --init Run an init inside containers to forward signals and reap processes + --init-path Path to the docker-init binary --insecure-registry=[] Enable insecure registry communication --ip=0.0.0.0 Default IP when binding container ports --ip-forward=true Enable net.ipv4.ip_forward @@ -77,6 +78,7 @@ Options: --tlskey=~/.docker/key.pem Path to TLS key file --tlsverify Use TLS and verify the remote --userland-proxy=true Use userland proxy for loopback traffic + --userland-proxy-path="" Path to the userland proxy binary --userns-remap User/Group setting for user namespaces -v, --version Print version information and quit ``` @@ -237,7 +239,7 @@ snapshots. For each devicemapper graph location – typically `/var/lib/docker/devicemapper` – a thin pool is created based on two block devices, one for data and one for metadata. By default, these block devices are created automatically by using loopback mounts of automatically created -sparse files. Refer to [Storage driver options](dockerd.md#storage-driver-options) below +sparse files. Refer to [Storage driver options](#storage-driver-options) below for a way how to customize this setup. [~jpetazzo/Resizing Docker containers with the Device Mapper plugin](http://jpetazzo.github.io/2014/01/29/docker-device-mapper-resize/) article explains how to tune your existing setup without the use of options. @@ -249,7 +251,7 @@ does not share executable memory between devices. Use The `zfs` driver is probably not as fast as `btrfs` but has a longer track record on stability. Thanks to `Single Copy ARC` shared blocks between clones will be cached only once. Use `dockerd -s zfs`. To select a different zfs filesystem -set `zfs.fsname` option as described in [Storage driver options](dockerd.md#storage-driver-options). +set `zfs.fsname` option as described in [Storage driver options](#storage-driver-options). The `overlay` is a very fast union filesystem. It is now merged in the main Linux kernel as of [3.18.0](https://lkml.org/lkml/2014/10/26/137). `overlay` @@ -599,6 +601,22 @@ options for `zfs` start with `zfs` and options for `btrfs` start with `btrfs`. $ sudo dockerd --storage-opt dm.min_free_space=10% ``` +* `dm.xfs_nospace_max_retries` + + Specifies the maximum number of retries XFS should attempt to complete + IO when ENOSPC (no space) error is returned by underlying storage device. + + By default XFS retries infinitely for IO to finish and this can result + in unkillable process. To change this behavior one can set + xfs_nospace_max_retries to say 0 and XFS will not retry IO after getting + ENOSPC and will shutdown filesystem. + + Example use: + + ```bash + $ sudo dockerd --storage-opt dm.xfs_nospace_max_retries=0 + ``` + #### ZFS options * `zfs.fsname` @@ -617,7 +635,7 @@ options for `zfs` start with `zfs` and options for `btrfs` start with `btrfs`. * `btrfs.min_space` - Specifies the minimum size to use when creating the subvolume which is used + Specifies the mininum size to use when creating the subvolume which is used for containers. If user uses disk quota for btrfs when creating or running a container with **--storage-opt size** option, docker should ensure the **size** cannot be smaller than **btrfs.min_space**. @@ -642,7 +660,7 @@ options for `zfs` start with `zfs` and options for `btrfs` start with `btrfs`. ## Docker runtime execution options The Docker daemon relies on a -[OCI](https://github.com/opencontainers/specs) compliant runtime +[OCI](https://github.com/opencontainers/runtime-spec) compliant runtime (invoked via the `containerd` daemon) as its interface to the Linux kernel `namespaces`, `cgroups`, and `SELinux`. @@ -995,7 +1013,7 @@ following algorithm to create the mapping ranges: If you enable user namespaces on the daemon, all containers are started with user namespaces enabled. In some situations you might want to disable this feature for a container, for example, to start a privileged container (see -[user namespace known restrictions](dockerd.md#user-namespace-known-restrictions)). +[user namespace known restrictions](#user-namespace-known-restrictions)). To enable those advanced features for a specific container use `--userns=host` in the `run/exec/create` command. This option will completely disable user namespace mapping for the container's user. @@ -1005,16 +1023,16 @@ This option will completely disable user namespace mapping for the container's u The following standard Docker features are currently incompatible when running a Docker daemon with user namespaces enabled: - - sharing PID or NET namespaces with the host (`--pid=host` or `--network=host`) - - A `--read-only` container filesystem (this is a Linux kernel restriction against remounting with modified flags of a currently mounted filesystem when inside a user namespace) - - external (volume or graph) drivers which are unaware/incapable of using daemon user mappings + - sharing PID or NET namespaces with the host (`--pid=host` or `--net=host`) - Using `--privileged` mode flag on `docker run` (unless also specifying `--userns=host`) In general, user namespaces are an advanced feature and will require coordination with other capabilities. For example, if volumes are mounted from the host, file ownership will have to be pre-arranged if the user or administrator wishes the containers to have expected access to the volume -contents. +contents. Note that when using external volume or graph driver plugins, those +external software programs must be made aware of user and group mapping ranges +if they are to work seamlessly with user namespace support. Finally, while the `root` user inside a user namespaced container process has many of the expected admin privileges that go along with being the superuser, the @@ -1125,11 +1143,14 @@ This is a full example of the allowed configuration options on Linux: "group": "", "cgroup-parent": "", "default-ulimits": {}, + "init": false, + "init-path": "/usr/libexec/docker-init", "ipv6": false, "iptables": false, "ip-forward": false, "ip-masq": false, "userland-proxy": false, + "userland-proxy-path": "/usr/libexec/docker-proxy", "ip": "0.0.0.0", "bridge": "", "bip": "", @@ -1226,6 +1247,7 @@ The list of currently supported options that can be reconfigured is this: the runtime shipped with the official docker packages. - `runtimes`: it updates the list of available OCI runtimes that can be used to run containers +- `authorization-plugin`: specifies the authorization plugins to use. Updating and reloading the cluster configurations such as `--cluster-store`, `--cluster-advertise` and `--cluster-store-opts` will take effect only if @@ -1245,7 +1267,7 @@ previously configured cluster configurations. This section describes how to run multiple Docker daemons on a single host. To run multiple daemons, you must configure each daemon so that it does not conflict with other daemons on the same host. You can set these options either -by providing them as flags, or by using a [daemon configuration file](dockerd.md#daemon-configuration-file). +by providing them as flags, or by using a [daemon configuration file](#daemon-configuration-file). The following daemon options must be configured for each daemon: diff --git a/engine/reference/commandline/events.md b/engine/reference/commandline/events.md index c69b44ccd5b..789bb57ffb3 100644 --- a/engine/reference/commandline/events.md +++ b/engine/reference/commandline/events.md @@ -1,12 +1,12 @@ ---- -description: The events command description and usage -keywords: -- events, container, report -menu: - main: - parent: smn_cli -title: events ---- + # events @@ -17,6 +17,7 @@ Get real time events from the server Options: -f, --filter value Filter output based on conditions provided (default []) + --format string Format the output using the given go template --help Print usage --since string Show all events created since timestamp --until string Stream events until this timestamp @@ -85,6 +86,16 @@ The currently supported filters are: * network (`network=`) * daemon (`daemon=`) +## 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/ . + ## Examples You'll need two shells for this example. @@ -180,3 +191,22 @@ relative to the current time on the client machine: $ docker events --filter 'type=plugin' (experimental) 2016-07-25T17:30:14.825557616Z plugin pull ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) 2016-07-25T17:30:14.888127370Z plugin enable ec7b87f2ce84330fe076e666f17dfc049d2d7ae0b8190763de94e1f2d105993f (name=tiborvass/no-remove:latest) + +**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 + +**Format (as JSON Lines):** + + $ 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.. diff --git a/engine/reference/commandline/exec.md b/engine/reference/commandline/exec.md index a28b6b7a0d4..3f422de6622 100644 --- a/engine/reference/commandline/exec.md +++ b/engine/reference/commandline/exec.md @@ -1,12 +1,12 @@ ---- -description: The exec command description and usage -keywords: -- command, container, run, execute -menu: - main: - parent: smn_cli -title: exec ---- + # exec @@ -15,11 +15,12 @@ Usage: docker exec [OPTIONS] CONTAINER COMMAND [ARG...] Run a command in a running container +Options: -d, --detach Detached mode: run command in the background - --detach-keys Override the key sequence for detaching a container - --help Print usage + --detach-keys Override the key sequence for detaching a container + --help Print usage -i, --interactive Keep STDIN open even if not attached - --privileged Give extended privileges to the command + --privileged Give extended privileges to the command -t, --tty Allocate a pseudo-TTY -u, --user Username or UID (format: [:]) ``` diff --git a/engine/reference/commandline/export.md b/engine/reference/commandline/export.md index 7af0e6c5c1d..54e6e01a6ea 100644 --- a/engine/reference/commandline/export.md +++ b/engine/reference/commandline/export.md @@ -1,12 +1,12 @@ ---- -description: The export command description and usage -keywords: -- export, file, system, container -menu: - main: - parent: smn_cli -title: export ---- + # export diff --git a/engine/reference/commandline/history.md b/engine/reference/commandline/history.md index eb568b6bdfe..895fd55ea97 100644 --- a/engine/reference/commandline/history.md +++ b/engine/reference/commandline/history.md @@ -1,12 +1,12 @@ ---- -description: The history command description and usage -keywords: -- docker, image, history -menu: - main: - parent: smn_cli -title: history ---- + # history diff --git a/engine/reference/commandline/image_prune.md b/engine/reference/commandline/image_prune.md new file mode 100644 index 00000000000..85bd8ce1a66 --- /dev/null +++ b/engine/reference/commandline/image_prune.md @@ -0,0 +1,65 @@ + + +# image prune + +```markdown +Usage: docker image prune [OPTIONS] + +Remove unused images + +Options: + -a, --all Remove all unused images, not just dangling ones + -f, --force Do not prompt for confirmation + --help Print usage +``` + +Remove all dangling images. If `-a` is specified, will also remove all images not referenced by any container. + +Example output: + +```bash +$ docker image prune -a +WARNING! This will remove all images without at least one container associated to them. +Are you sure you want to continue? [y/N] y +Deleted Images: +untagged: alpine:latest +untagged: alpine@sha256:3dcdb92d7432d56604d4545cbd324b14e647b313626d99b889d0626de158f73a +deleted: sha256:4e38e38c8ce0b8d9041a9c4fefe786631d1416225e13b0bfe8cfa2321aec4bba +deleted: sha256:4fe15f8d0ae69e169824f25f1d4da3015a48feeeeebb265cd2e328e15c6a869f +untagged: alpine:3.3 +untagged: alpine@sha256:4fa633f4feff6a8f02acfc7424efd5cb3e76686ed3218abf4ca0fa4a2a358423 +untagged: my-jq:latest +deleted: sha256:ae67841be6d008a374eff7c2a974cde3934ffe9536a7dc7ce589585eddd83aff +deleted: sha256:34f6f1261650bc341eb122313372adc4512b4fceddc2a7ecbb84f0958ce5ad65 +deleted: sha256:cf4194e8d8db1cb2d117df33f2c75c0369c3a26d96725efb978cc69e046b87e7 +untagged: my-curl:latest +deleted: sha256:b2789dd875bf427de7f9f6ae001940073b3201409b14aba7e5db71f408b8569e +deleted: sha256:96daac0cb203226438989926fc34dd024f365a9a8616b93e168d303cfe4cb5e9 +deleted: sha256:5cbd97a14241c9cd83250d6b6fc0649833c4a3e84099b968dd4ba403e609945e +deleted: sha256:a0971c4015c1e898c60bf95781c6730a05b5d8a2ae6827f53837e6c9d38efdec +deleted: sha256:d8359ca3b681cc5396a4e790088441673ed3ce90ebc04de388bfcd31a0716b06 +deleted: sha256:83fc9ba8fb70e1da31dfcc3c88d093831dbd4be38b34af998df37e8ac538260c +deleted: sha256:ae7041a4cc625a9c8e6955452f7afe602b401f662671cea3613f08f3d9343b35 +deleted: sha256:35e0f43a37755b832f0bbea91a2360b025ee351d7309dae0d9737bc96b6d0809 +deleted: sha256:0af941dd29f00e4510195dd00b19671bc591e29d1495630e7e0f7c44c1e6a8c0 +deleted: sha256:9fc896fc2013da84f84e45b3096053eb084417b42e6b35ea0cce5a3529705eac +deleted: sha256:47cf20d8c26c46fff71be614d9f54997edacfe8d46d51769706e5aba94b16f2b +deleted: sha256:2c675ee9ed53425e31a13e3390bf3f539bf8637000e4bcfbb85ee03ef4d910a1 + +Total reclaimed space: 16.43 MB +``` + +## Related information + +* [system df](system_df.md) +* [container prune](container_prune.md) +* [volume prune](volume_prune.md) +* [system prune](system_prune.md) diff --git a/engine/reference/commandline/images.md b/engine/reference/commandline/images.md index 494b23bc8af..af21a8197dc 100644 --- a/engine/reference/commandline/images.md +++ b/engine/reference/commandline/images.md @@ -1,12 +1,12 @@ ---- -description: The images command description and usage -keywords: -- list, docker, images -menu: - main: - parent: smn_cli -title: images ---- + # images @@ -249,7 +249,6 @@ output the data exactly as the template declares or, when using the The following example uses a template without headers and outputs the `ID` and `Repository` entries separated by a colon for all images: - {% raw %} $ docker images --format "{{.ID}}: {{.Repository}}" 77af4d6b9913: b6fa739cedf5: committ @@ -260,12 +259,10 @@ The following example uses a template without headers and outputs the 746b819f315e: postgres 746b819f315e: postgres 746b819f315e: postgres - {% endraw %} To list all images with their repository and tag in a table format you can use: - {% raw %} $ docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Tag}}" IMAGE ID REPOSITORY TAG 77af4d6b9913 @@ -277,4 +274,3 @@ can use: 746b819f315e postgres 9.3 746b819f315e postgres 9.3.5 746b819f315e postgres latest - {% endraw %} diff --git a/engine/reference/commandline/import.md b/engine/reference/commandline/import.md index 7a637809152..2d2c88b4e87 100644 --- a/engine/reference/commandline/import.md +++ b/engine/reference/commandline/import.md @@ -1,12 +1,12 @@ ---- -description: The import command description and usage -keywords: -- import, file, system, container -menu: - main: - parent: smn_cli -title: import ---- + # import diff --git a/engine/reference/commandline/index.md b/engine/reference/commandline/index.md index 7f8bf6b2189..ed8d2996a8b 100644 --- a/engine/reference/commandline/index.md +++ b/engine/reference/commandline/index.md @@ -1,14 +1,16 @@ ---- -description: Docker's CLI command description and usage -keywords: -- Docker, Docker documentation, CLI, command line -menu: - main: - identifier: smn_cli_guide - parent: smn_cli - weight: -70 -title: Docker commands ---- + + + # The Docker commands @@ -113,7 +115,7 @@ read the [`dockerd`](dockerd.md) reference page. | [node demote](node_demote.md) | Demotes an existing manager so that it is no longer a manager | | [node inspect](node_inspect.md) | Inspect a node in the swarm | | [node update](node_update.md) | Update attributes for a node | -| [node ps](node_ps.md) | List tasks running on a node | +| [node ps](node_ps.md) | List tasks running on one or more nodes | | [node ls](node_ls.md) | List nodes in the swarm | | [node rm](node_rm.md) | Remove one or more nodes from the swarm | diff --git a/engine/reference/commandline/info.md b/engine/reference/commandline/info.md index c69f3c8436c..3bf813c0573 100644 --- a/engine/reference/commandline/info.md +++ b/engine/reference/commandline/info.md @@ -1,22 +1,23 @@ ---- -description: The info command description and usage -keywords: -- display, docker, information -menu: - main: - parent: smn_cli -title: info ---- + # info ```markdown -Usage: docker info +Usage: docker info [OPTIONS] Display system-wide information Options: - --help Print usage + -f, --format string Format the output using the given go template + --help Print usage ``` This command displays system wide information regarding the Docker installation. @@ -24,6 +25,10 @@ Information displayed includes the kernel version, number of containers and imag 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. @@ -144,3 +149,41 @@ information about the devicemapper storage driver is shown: Insecure registries: myinsecurehost:5000 127.0.0.0/8 + +You can also specify the output format: + + $ docker info --format '{{json .}}' + {"ID":"I54V:OLXT:HVMM:TPKO:JPHQ:CQCD:JNLC:O3BZ:4ZVJ:43XJ:PFHZ:6N2S","Containers":14, ...} + +Here is a sample output for a daemon running on Windows Server 2016: + + E:\docker>docker info + Containers: 1 + Running: 0 + Paused: 0 + Stopped: 1 + Images: 17 + Server Version: 1.13.0-dev + 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 + Live Restore Enabled: false \ No newline at end of file diff --git a/engine/reference/commandline/inspect.md b/engine/reference/commandline/inspect.md index f6a904b6752..d5c073f26c1 100644 --- a/engine/reference/commandline/inspect.md +++ b/engine/reference/commandline/inspect.md @@ -1,25 +1,27 @@ ---- -description: The inspect command description and usage -keywords: -- inspect, container, json -menu: - main: - parent: smn_cli -title: inspect ---- + # inspect ```markdown -Usage: docker inspect [OPTIONS] CONTAINER|IMAGE|TASK [CONTAINER|IMAGE|TASK...] +Usage: docker inspect [OPTIONS] NAME|ID [NAME|ID...] -Return low-level information on a container, image or task +Return low-level information on one or multiple containers, images, volumes, +networks, nodes, services, or tasks identified by name or ID. +Options: -f, --format Format the output using the given go template - --help Print usage + --help Print usage -s, --size Display total file sizes if the type is container values are "image" or "container" or "task - --type Return JSON for specified type, (e.g image, container or task) + --type Return JSON for specified type ``` By default, this will render all results in a JSON array. If the container and @@ -36,39 +38,29 @@ describes all the details of the format. For the most part, you can pick out any field from the JSON in a fairly straightforward manner. - {% raw %} $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $INSTANCE_ID - {% endraw %} **Get an instance's MAC address:** For the most part, you can pick out any field from the JSON in a fairly straightforward manner. - {% raw %} $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.MacAddress}}{{end}}' $INSTANCE_ID - {% endraw %} **Get an instance's log path:** - {% raw %} $ docker inspect --format='{{.LogPath}}' $INSTANCE_ID - {% endraw %} **Get a Task's image name:** - {% raw %} $ docker inspect --format='{{.Container.Spec.Image}}' $INSTANCE_ID - {% endraw %} **List all port bindings:** One can loop over arrays and maps in the results to produce simple text output: - {% raw %} $ docker inspect --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' $INSTANCE_ID - {% endraw %} **Find a specific port mapping:** @@ -80,9 +72,7 @@ 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. - {% raw %} $ docker inspect --format='{{(index (index .NetworkSettings.Ports "8787/tcp") 0).HostPort}}' $INSTANCE_ID - {% endraw %} **Get a subsection in JSON format:** @@ -91,6 +81,4 @@ 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. - {% raw %} $ docker inspect --format='{{json .Config}}' $INSTANCE_ID - {% endraw %} diff --git a/engine/reference/commandline/kill.md b/engine/reference/commandline/kill.md index 4372bdb6e83..55b11efad28 100644 --- a/engine/reference/commandline/kill.md +++ b/engine/reference/commandline/kill.md @@ -1,12 +1,12 @@ ---- -description: The kill command description and usage -keywords: -- container, kill, signal -menu: - main: - parent: smn_cli -title: kill ---- + # kill diff --git a/engine/reference/commandline/load.md b/engine/reference/commandline/load.md index 021e1fe0455..be8ed05cf21 100644 --- a/engine/reference/commandline/load.md +++ b/engine/reference/commandline/load.md @@ -1,12 +1,12 @@ ---- -description: The load command description and usage -keywords: -- stdin, tarred, repository -menu: - main: - parent: smn_cli -title: load ---- + # load diff --git a/engine/reference/commandline/login.md b/engine/reference/commandline/login.md index 206508c53a2..3308ae5d6bc 100644 --- a/engine/reference/commandline/login.md +++ b/engine/reference/commandline/login.md @@ -1,12 +1,12 @@ ---- -description: The login command description and usage -keywords: -- registry, login, image -menu: - main: - parent: smn_cli -title: login ---- + # login @@ -57,7 +57,7 @@ you can download them from: ### Usage -You need to specify the credentials store in `$HOME/.docker/config.json` +You need to speficy the credentials store in `$HOME/.docker/config.json` to tell the docker engine to use it: ```json diff --git a/engine/reference/commandline/logout.md b/engine/reference/commandline/logout.md index 0de15f53afc..a073b34f88a 100644 --- a/engine/reference/commandline/logout.md +++ b/engine/reference/commandline/logout.md @@ -1,12 +1,12 @@ ---- -description: The logout command description and usage -keywords: -- logout, docker, registry -menu: - main: - parent: smn_cli -title: logout ---- + # logout diff --git a/engine/reference/commandline/logs.md b/engine/reference/commandline/logs.md index afa94a3997f..437e7096315 100644 --- a/engine/reference/commandline/logs.md +++ b/engine/reference/commandline/logs.md @@ -1,12 +1,12 @@ ---- -description: The logs command description and usage -keywords: -- logs, retrieve, docker -menu: - main: - parent: smn_cli -title: logs ---- + # logs diff --git a/engine/reference/commandline/menu.md b/engine/reference/commandline/menu.md index 3a2876fc2af..9ade86d26a6 100644 --- a/engine/reference/commandline/menu.md +++ b/engine/reference/commandline/menu.md @@ -1,14 +1,16 @@ ---- -description: Docker's CLI command description and usage -keywords: -- Docker, Docker documentation, CLI, command line -menu: - main: - identifier: smn_cli - parent: engine_ref - weight: -75 -title: Command line reference ---- + + + # The Docker commands diff --git a/engine/reference/commandline/network_connect.md b/engine/reference/commandline/network_connect.md index 3ff621e51f5..5a9ed866efa 100644 --- a/engine/reference/commandline/network_connect.md +++ b/engine/reference/commandline/network_connect.md @@ -1,12 +1,12 @@ ---- -description: The network connect command description and usage -keywords: -- network, connect, user-defined -menu: - main: - parent: smn_cli -title: network connect ---- + # network connect diff --git a/engine/reference/commandline/network_create.md b/engine/reference/commandline/network_create.md index 12be4398e60..8ffed10972d 100644 --- a/engine/reference/commandline/network_create.md +++ b/engine/reference/commandline/network_create.md @@ -1,12 +1,12 @@ ---- -description: The network create command description and usage -keywords: -- network, create -menu: - main: - parent: smn_cli -title: network create ---- + # network create diff --git a/engine/reference/commandline/network_disconnect.md b/engine/reference/commandline/network_disconnect.md index b0c8b6d0fab..2d43ccb1e93 100644 --- a/engine/reference/commandline/network_disconnect.md +++ b/engine/reference/commandline/network_disconnect.md @@ -1,12 +1,12 @@ ---- -description: The network disconnect command description and usage -keywords: -- network, disconnect, user-defined -menu: - main: - parent: smn_cli -title: network disconnect ---- + # network disconnect diff --git a/engine/reference/commandline/network_inspect.md b/engine/reference/commandline/network_inspect.md index c6112a09e61..9aebc66b5ad 100644 --- a/engine/reference/commandline/network_inspect.md +++ b/engine/reference/commandline/network_inspect.md @@ -1,12 +1,12 @@ ---- -description: The network inspect command description and usage -keywords: -- network, inspect, user-defined -menu: - main: - parent: smn_cli -title: network inspect ---- + # network inspect @@ -80,7 +80,8 @@ $ sudo docker network inspect bridge "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", "com.docker.network.bridge.name": "docker0", "com.docker.network.driver.mtu": "1500" - } + }, + "Labels": {} } ] ``` @@ -102,12 +103,13 @@ $ docker network inspect simple-network "Config": [ { "Subnet": "172.22.0.0/16", - "Gateway": "172.22.0.1/16" + "Gateway": "172.22.0.1" } ] }, "Containers": {}, - "Options": {} + "Options": {}, + "Labels": {} } ] ``` diff --git a/engine/reference/commandline/network_ls.md b/engine/reference/commandline/network_ls.md index c2540458763..18a65da06af 100644 --- a/engine/reference/commandline/network_ls.md +++ b/engine/reference/commandline/network_ls.md @@ -1,12 +1,12 @@ ---- -description: The network ls command description and usage -keywords: -- network, list, user-defined -menu: - main: - parent: smn_cli -title: network ls ---- + # docker network ls @@ -20,6 +20,7 @@ Aliases: Options: -f, --filter value Provide filter values (i.e. 'dangling=true') (default []) + --format string Pretty-print networks using a Go template --help Print usage --no-trunc Do not truncate the output -q, --quiet Only display network IDs @@ -169,6 +170,38 @@ $ docker network rm `docker network ls --filter type=custom -q` A warning will be issued when trying to remove a network that has containers attached. +## Formatting + +The formatting options (`--format`) pretty-prints networks output +using a Go template. + +Valid placeholders for the Go template are listed below: + +Placeholder | Description +------------|------------------------------------------------------------------------------------------ +`.ID` | Network ID +`.Name` | Network name +`.Driver` | Network driver +`.Scope` | Network scope (local, global) +`.IPv6` | Whether IPv6 is enabled on the network or not. +`.Internal` | Whether the network is internal or not. +`.Labels` | All labels assigned to the network. +`.Label` | Value of a specific label for this network. For example `{{.Label "project.version"}}` + +When using the `--format` option, the `network ls` command will either +output the data exactly as the template declares or, when using the +`table` directive, includes column headers as well. + +The following example uses a template without headers and outputs the +`ID` and `Driver` entries separated by a colon for all networks: + +```bash +$ docker network ls --format "{{.ID}}: {{.Driver}}" +afaaab448eb2: bridge +d1584f8dc718: host +391df270dc66: null +``` + ## Related information * [network disconnect ](network_disconnect.md) diff --git a/engine/reference/commandline/network_rm.md b/engine/reference/commandline/network_rm.md index 10fb08de149..d57254636af 100644 --- a/engine/reference/commandline/network_rm.md +++ b/engine/reference/commandline/network_rm.md @@ -1,12 +1,12 @@ ---- -description: the network rm command description and usage -keywords: -- network, rm, user-defined -menu: - main: - parent: smn_cli -title: network rm ---- + # network rm diff --git a/engine/reference/commandline/node_demote.md b/engine/reference/commandline/node_demote.md index 935eaef37aa..2cec22ac3b0 100644 --- a/engine/reference/commandline/node_demote.md +++ b/engine/reference/commandline/node_demote.md @@ -1,12 +1,12 @@ ---- -description: The node demote command description and usage -keywords: -- node, demote -menu: - main: - parent: smn_cli -title: node demote ---- + # node demote diff --git a/engine/reference/commandline/node_inspect.md b/engine/reference/commandline/node_inspect.md index f7578997bd1..2f3370adbc6 100644 --- a/engine/reference/commandline/node_inspect.md +++ b/engine/reference/commandline/node_inspect.md @@ -1,14 +1,12 @@ ---- -description: The node inspect command description and usage -keywords: -- node, inspect -menu: - main: - parent: smn_cli -title: node inspect ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # node inspect @@ -95,10 +93,8 @@ Example output: } ] - {% raw %} $ docker node inspect --format '{{ .ManagerStatus.Leader }}' self false - {% endraw %} $ docker node inspect --pretty self ID: e216jshn25ckzbvmwlnh5jr3g diff --git a/engine/reference/commandline/node_ls.md b/engine/reference/commandline/node_ls.md index 5b099fb2dfc..e918b7d11ab 100644 --- a/engine/reference/commandline/node_ls.md +++ b/engine/reference/commandline/node_ls.md @@ -1,14 +1,12 @@ ---- -description: The node ls command description and usage -keywords: -- node, list -menu: - main: - parent: smn_cli -title: node ls ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # node ls @@ -26,7 +24,7 @@ Options: -q, --quiet Only display IDs ``` -Lists all the nodes that the Docker Swarm manager knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](node_ls.md#filtering) section for more information about available filter options. +Lists all the nodes that the Docker Swarm manager knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options. Example output: diff --git a/engine/reference/commandline/node_promote.md b/engine/reference/commandline/node_promote.md index 37bc6aa7838..7f5830d92a3 100644 --- a/engine/reference/commandline/node_promote.md +++ b/engine/reference/commandline/node_promote.md @@ -1,12 +1,12 @@ ---- -description: The node promote command description and usage -keywords: -- node, promote -menu: - main: - parent: smn_cli -title: node promote ---- + # node promote diff --git a/engine/reference/commandline/node_ps.md b/engine/reference/commandline/node_ps.md index 4f2b9e9ee17..538132408af 100644 --- a/engine/reference/commandline/node_ps.md +++ b/engine/reference/commandline/node_ps.md @@ -1,43 +1,40 @@ ---- -aliases: -- /engine/reference/commandline/node_tasks/ -description: The node ps command description and usage -keywords: -- node, tasks -- ps -menu: - main: - parent: smn_cli -title: node ps ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # node ps ```markdown -Usage: docker node ps [OPTIONS] self|NODE +Usage: docker node ps [OPTIONS] [NODE...] -List tasks running on a node +List tasks running on one or more nodes, defaults to current node. Options: -a, --all Display all instances -f, --filter value Filter output based on conditions provided --help Print usage --no-resolve Do not map IDs to Names + --no-trunc Do not truncate output ``` -Lists all the tasks on a Node that Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](node_ps.md#filtering) section for more information about available filter options. +Lists all the tasks on a Node that Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options. Example output: $ docker node ps swarm-manager1 - ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE - 7q92v0nr1hcgts2amcjyqg3pq redis.1 redis redis:3.0.6 Running 5 hours Running swarm-manager1 - b465edgho06e318egmgjbqo4o redis.6 redis redis:3.0.6 Running 29 seconds Running swarm-manager1 - bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 5 seconds Running swarm-manager1 - dkkual96p4bb3s6b10r7coxxt redis.9 redis redis:3.0.6 Running 5 seconds Running swarm-manager1 - 0tgctg8h8cech4w0k0gwrmr23 redis.10 redis redis:3.0.6 Running 5 seconds Running swarm-manager1 + NAME IMAGE NODE DESIRED STATE CURRENT STATE + redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours + redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds + redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds + redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds + redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds ## Filtering @@ -47,10 +44,10 @@ than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "b The currently supported filters are: -* [name](node_ps.md#name) -* [id](node_ps.md#id) -* [label](node_ps.md#label) -* [desired-state](node_ps.md#desired-state) +* [name](#name) +* [id](#id) +* [label](#label) +* [desired-state](#desired-state) #### name @@ -59,12 +56,12 @@ The `name` filter matches on all or part of a task's name. The following filter matches all tasks with a name containing the `redis` string. $ docker node ps -f name=redis swarm-manager1 - ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE - 7q92v0nr1hcgts2amcjyqg3pq redis.1 redis redis:3.0.6 Running 5 hours Running swarm-manager1 - b465edgho06e318egmgjbqo4o redis.6 redis redis:3.0.6 Running 29 seconds Running swarm-manager1 - bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 5 seconds Running swarm-manager1 - dkkual96p4bb3s6b10r7coxxt redis.9 redis redis:3.0.6 Running 5 seconds Running swarm-manager1 - 0tgctg8h8cech4w0k0gwrmr23 redis.10 redis redis:3.0.6 Running 5 seconds Running swarm-manager1 + NAME IMAGE NODE DESIRED STATE CURRENT STATE + redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 swarm-manager1 Running Running 5 hours + redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 29 seconds + redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds + redis.9.dkkual96p4bb3s6b10r7coxxt redis:3.0.6 swarm-manager1 Running Running 5 seconds + redis.10.0tgctg8h8cech4w0k0gwrmr23 redis:3.0.6 swarm-manager1 Running Running 5 seconds #### id @@ -72,8 +69,8 @@ The following filter matches all tasks with a name containing the `redis` string The `id` filter matches a task's id. $ docker node ps -f id=bg8c07zzg87di2mufeq51a2qp swarm-manager1 - ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE - bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 5 seconds Running swarm-manager1 + NAME IMAGE NODE DESIRED STATE CURRENT STATE + redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 5 seconds #### label @@ -85,9 +82,9 @@ The following filter matches tasks with the `usage` label regardless of its valu ```bash $ docker node ps -f "label=usage" -ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE -b465edgho06e318egmgjbqo4o redis.6 redis redis:3.0.6 Running 10 minutes Running swarm-manager1 -bg8c07zzg87di2mufeq51a2qp redis.7 redis redis:3.0.6 Running 9 minutes Running swarm-manager1 +NAME IMAGE NODE DESIRED STATE CURRENT STATE +redis.6.b465edgho06e318egmgjbqo4o redis:3.0.6 swarm-manager1 Running Running 10 minutes +redis.7.bg8c07zzg87di2mufeq51a2qp redis:3.0.6 swarm-manager1 Running Running 9 minutes ``` diff --git a/engine/reference/commandline/node_rm.md b/engine/reference/commandline/node_rm.md index 426e06b0c14..ee6dcf72121 100644 --- a/engine/reference/commandline/node_rm.md +++ b/engine/reference/commandline/node_rm.md @@ -1,14 +1,12 @@ ---- -description: The node rm command description and usage -keywords: -- node, remove -menu: - main: - parent: smn_cli -title: node rm ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # node rm diff --git a/engine/reference/commandline/node_update.md b/engine/reference/commandline/node_update.md index 47fb583350b..5205a7d96aa 100644 --- a/engine/reference/commandline/node_update.md +++ b/engine/reference/commandline/node_update.md @@ -1,14 +1,12 @@ ---- -description: The node update command description and usage -keywords: -- resources, update, dynamically -menu: - main: - parent: smn_cli -title: node update ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + ## update diff --git a/engine/reference/commandline/pause.md b/engine/reference/commandline/pause.md index d109e3ffade..629c6ed0915 100644 --- a/engine/reference/commandline/pause.md +++ b/engine/reference/commandline/pause.md @@ -1,12 +1,12 @@ ---- -description: The pause command description and usage -keywords: -- cgroups, container, suspend, SIGSTOP -menu: - main: - parent: smn_cli -title: pause ---- + # pause diff --git a/engine/reference/commandline/plugin_disable.md b/engine/reference/commandline/plugin_disable.md index f4000937101..eae31975e10 100644 --- a/engine/reference/commandline/plugin_disable.md +++ b/engine/reference/commandline/plugin_disable.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: the plugin disable command description and usage -keywords: -- plugin, disable -menu: - main: - parent: smn_cli -title: plugin disable ---- + # plugin disable (experimental) @@ -25,13 +25,13 @@ see [`docker plugin install`](plugin_install.md). The following example shows that the `no-remove` plugin is installed -and active: +and enabled: ```bash $ docker plugin ls -NAME TAG ACTIVE -tiborvass/no-remove latest true +NAME TAG DESCRIPTION ENABLED +tiborvass/no-remove latest A test plugin for Docker true ``` To disable the plugin, use the following command: @@ -40,15 +40,11 @@ To disable the plugin, use the following command: $ docker plugin disable tiborvass/no-remove tiborvass/no-remove -``` - -After the plugin is disabled, it appears as "inactive" in the list of plugins: -```bash $ docker plugin ls -NAME VERSION ACTIVE -tiborvass/no-remove latest false +NAME TAG DESCRIPTION ENABLED +tiborvass/no-remove latest A test plugin for Docker false ``` ## Related information diff --git a/engine/reference/commandline/plugin_enable.md b/engine/reference/commandline/plugin_enable.md index 6e73811bf09..44ef3c2fa3c 100644 --- a/engine/reference/commandline/plugin_enable.md +++ b/engine/reference/commandline/plugin_enable.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: the plugin enable command description and usage -keywords: -- plugin, enable -menu: - main: - parent: smn_cli -title: plugin enable ---- + # plugin enable (experimental) @@ -25,13 +25,13 @@ see [`docker plugin install`](plugin_install.md). The following example shows that the `no-remove` plugin is installed, -but disabled ("inactive"): +but disabled: ```bash $ docker plugin ls -NAME VERSION ACTIVE -tiborvass/no-remove latest false +NAME TAG DESCRIPTION ENABLED +tiborvass/no-remove latest A test plugin for Docker false ``` To enable the plugin, use the following command: @@ -40,15 +40,11 @@ To enable the plugin, use the following command: $ docker plugin enable tiborvass/no-remove tiborvass/no-remove -``` - -After the plugin is enabled, it appears as "active" in the list of plugins: -```bash $ docker plugin ls -NAME VERSION ACTIVE -tiborvass/no-remove latest true +NAME TAG DESCRIPTION ENABLED +tiborvass/no-remove latest A test plugin for Docker true ``` ## Related information diff --git a/engine/reference/commandline/plugin_inspect.md b/engine/reference/commandline/plugin_inspect.md old mode 100644 new mode 100755 index a18af329afe..e8c219d2661 --- a/engine/reference/commandline/plugin_inspect.md +++ b/engine/reference/commandline/plugin_inspect.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: The plugin inspect command description and usage -keywords: -- plugin, inspect -menu: - main: - parent: smn_cli -title: plugin inspect ---- + # plugin inspect (experimental) @@ -17,7 +17,8 @@ Usage: docker plugin inspect [OPTIONS] PLUGIN [PLUGIN...] Display detailed information on one or more plugins Options: - --help Print usage + -f, --format string Format the output using the given go template + --help Print usage ``` Returns information about a plugin. By default, this command renders all results @@ -33,7 +34,7 @@ $ docker plugin inspect tiborvass/no-remove:latest "Id": "8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21", "Name": "tiborvass/no-remove", "Tag": "latest", - "Active": true, + "Enabled": true, "Config": { "Mounts": [ { @@ -138,6 +139,13 @@ $ docker plugin inspect tiborvass/no-remove:latest (output formatted for readability) +```bash +$ docker plugin inspect -f '{{.Id}}' tiborvass/no-remove:latest +``` +``` +8c74c978c434745c3ade82f1bc0acf38d04990eaf494fa507c16d9f1daa99c21 +``` + ## Related information diff --git a/engine/reference/commandline/plugin_install.md b/engine/reference/commandline/plugin_install.md index aa718abf44e..f3b26ab0c83 100644 --- a/engine/reference/commandline/plugin_install.md +++ b/engine/reference/commandline/plugin_install.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: the plugin install command description and usage -keywords: -- plugin, install -menu: - main: - parent: smn_cli -title: plugin install ---- + # plugin install (experimental) @@ -17,14 +17,15 @@ Usage: docker plugin install [OPTIONS] PLUGIN Install a plugin Options: - --disable do not enable the plugin on install - --grant-all-permissions grant all permissions necessary to run the plugin + --disable Do not enable the plugin on install + --grant-all-permissions Grant all permissions necessary to run the plugin --help Print usage ``` Installs and enables a plugin. Docker looks first for the plugin on your Docker host. If the plugin does not exist locally, then the plugin is pulled from -Docker Hub. +the registry. Note that the minimum required registry version to distribute +plugins is 2.3.0 The following example installs `no-remove` plugin. Install consists of pulling the @@ -47,8 +48,8 @@ After the plugin is installed, it appears in the list of plugins: ```bash $ docker plugin ls -NAME VERSION ACTIVE -tiborvass/no-remove latest true +NAME TAG DESCRIPTION ENABLED +tiborvass/no-remove latest A test plugin for Docker true ``` ## Related information diff --git a/engine/reference/commandline/plugin_ls.md b/engine/reference/commandline/plugin_ls.md index d0378a5c097..c73fb72dd2a 100644 --- a/engine/reference/commandline/plugin_ls.md +++ b/engine/reference/commandline/plugin_ls.md @@ -1,18 +1,18 @@ ---- -advisory: experimental -description: The plugin ls command description and usage -keywords: -- plugin, list -menu: - main: - parent: smn_cli -title: plugin ls ---- + # plugin ls (experimental) ```markdown -Usage: docker plugin ls +Usage: docker plugin ls [OPTIONS] List plugins @@ -20,7 +20,8 @@ Aliases: ls, list Options: - --help Print usage + --help Print usage + --no-trunc Don't truncate output ``` Lists all the plugins that are currently installed. You can install plugins @@ -31,8 +32,8 @@ Example output: ```bash $ docker plugin ls -NAME VERSION ACTIVE -tiborvass/no-remove latest true +NAME TAG DESCRIPTION ENABLED +tiborvass/no-remove latest A test plugin for Docker true ``` ## Related information diff --git a/engine/reference/commandline/plugin_rm.md b/engine/reference/commandline/plugin_rm.md index cae5505cb95..6b6a2239b62 100644 --- a/engine/reference/commandline/plugin_rm.md +++ b/engine/reference/commandline/plugin_rm.md @@ -1,18 +1,18 @@ ---- -advisory: experimental -description: the plugin rm command description and usage -keywords: -- plugin, rm -menu: - main: - parent: smn_cli -title: plugin rm ---- + # plugin rm (experimental) ```markdown -Usage: docker plugin rm PLUGIN +Usage: docker plugin rm [OPTIONS] PLUGIN [PLUGIN...] Remove one or more plugins @@ -20,12 +20,14 @@ Aliases: rm, remove Options: - --help Print usage + -f, --force Force the removal of an active plugin + --help Print usage ``` -Removes a plugin. You cannot remove a plugin if it is active, you must disable +Removes a plugin. You cannot remove a plugin if it is enabled, you must disable a plugin using the [`docker plugin disable`](plugin_disable.md) before removing -it. +it (or use --force, use of force is not recommended, since it can affect +functioning of running containers using the plugin). The following example disables and removes the `no-remove:latest` plugin; diff --git a/engine/reference/commandline/port.md b/engine/reference/commandline/port.md index ad9c2087909..e8da943c365 100644 --- a/engine/reference/commandline/port.md +++ b/engine/reference/commandline/port.md @@ -1,12 +1,12 @@ ---- -description: The port command description and usage -keywords: -- port, mapping, container -menu: - main: - parent: smn_cli -title: port ---- + # port diff --git a/engine/reference/commandline/ps.md b/engine/reference/commandline/ps.md index 94cd6a58de1..541979e8197 100644 --- a/engine/reference/commandline/ps.md +++ b/engine/reference/commandline/ps.md @@ -1,12 +1,12 @@ ---- -description: The ps command description and usage -keywords: -- container, running, list -menu: - main: - parent: smn_cli -title: ps ---- + # ps @@ -20,13 +20,14 @@ Options: -f, --filter value Filter output based on conditions provided (default []) - exited= an exit code of - label= or label== - - status=(created|restarting|running|paused|exited) + - status=(created|restarting|removing|running|paused|exited) - name= a container's name - id= a container's ID - before=(|) - since=(|) - ancestor=([:tag]||) containers created from an image or a descendant. + - is-task=(true|false) --format string Pretty-print containers using a Go template --help Print usage -n, --last int Show n last created containers (includes all states) (default -1) @@ -68,7 +69,7 @@ The currently supported filters are: * label (`label=` or `label==`) * name (container's name) * exited (int - the code of exited containers. Only useful with `--all`) -* status (created|restarting|running|paused|exited|dead) +* 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 @@ -119,7 +120,7 @@ You can also filter for a substring in a name as this shows: $ docker ps --filter "name=nostalgic" CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES -715ebfcee040 busybox "top" 3 seconds ago Up 1 seconds i_am_nostalgic +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 ``` @@ -148,7 +149,6 @@ $ 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: @@ -159,7 +159,7 @@ Any of these events result in a `137` status: #### Status The `status` filter matches containers by status. You can filter using -`created`, `restarting`, `running`, `paused`, `exited` and `dead`. For example, +`created`, `restarting`, `running`, `removing`, `paused`, `exited` and `dead`. For example, to filter for `running` containers: ```bash @@ -275,7 +275,7 @@ CONTAINER ID IMAGE COMMAND CREATED STATUS The `volume` filter shows only containers that mount a specific volume or have a volume mounted in a specific path: -```bash{% raw %} +```bash $ docker ps --filter volume=remote-volume --format "table {{.ID}}\t{{.Mounts}}" CONTAINER ID MOUNTS 9c3527ed70ce remote-volume @@ -283,7 +283,7 @@ CONTAINER ID MOUNTS $ docker ps --filter volume=/data --format "table {{.ID}}\t{{.Mounts}}" CONTAINER ID MOUNTS 9c3527ed70ce remote-volume -{% endraw %}``` +``` #### Network @@ -308,9 +308,7 @@ 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 @@ -339,7 +337,7 @@ Placeholder | Description `.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 %}'` +`.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. When using the `--format` option, the `ps` command will either output the data @@ -350,9 +348,7 @@ 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 @@ -363,9 +359,7 @@ c1d3b0166030: /bin/sh -c yum -y up 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 diff --git a/engine/reference/commandline/pull.md b/engine/reference/commandline/pull.md index 3291c011365..f10c1348631 100644 --- a/engine/reference/commandline/pull.md +++ b/engine/reference/commandline/pull.md @@ -1,12 +1,12 @@ ---- -description: The pull command description and usage -keywords: -- pull, image, hub, docker -menu: - main: - parent: smn_cli -title: pull ---- + # pull diff --git a/engine/reference/commandline/push.md b/engine/reference/commandline/push.md index 540d747ef8e..9b70fd3516a 100644 --- a/engine/reference/commandline/push.md +++ b/engine/reference/commandline/push.md @@ -1,12 +1,12 @@ ---- -description: The push command description and usage -keywords: -- share, push, image -menu: - main: - parent: smn_cli -title: push ---- + # push diff --git a/engine/reference/commandline/rename.md b/engine/reference/commandline/rename.md index 7ab90146d0f..f5a4fe23ec6 100644 --- a/engine/reference/commandline/rename.md +++ b/engine/reference/commandline/rename.md @@ -1,12 +1,12 @@ ---- -description: The rename command description and usage -keywords: -- rename, docker, container -menu: - main: - parent: smn_cli -title: rename ---- + # rename diff --git a/engine/reference/commandline/restart.md b/engine/reference/commandline/restart.md index 4a591d28a61..9e40a4f6c46 100644 --- a/engine/reference/commandline/restart.md +++ b/engine/reference/commandline/restart.md @@ -1,19 +1,19 @@ ---- -description: The restart command description and usage -keywords: -- restart, container, Docker -menu: - main: - parent: smn_cli -title: restart ---- + # restart ```markdown Usage: docker restart [OPTIONS] CONTAINER [CONTAINER...] -Restart a container +Restart one or more containers Options: --help Print usage diff --git a/engine/reference/commandline/rm.md b/engine/reference/commandline/rm.md index 5c78c50a262..319ef4dbbc4 100644 --- a/engine/reference/commandline/rm.md +++ b/engine/reference/commandline/rm.md @@ -1,12 +1,12 @@ ---- -description: The rm command description and usage -keywords: -- remove, Docker, container -menu: - main: - parent: smn_cli -title: rm ---- + # rm diff --git a/engine/reference/commandline/rmi.md b/engine/reference/commandline/rmi.md index 9bdc74072bb..328d9fe1403 100644 --- a/engine/reference/commandline/rmi.md +++ b/engine/reference/commandline/rmi.md @@ -1,12 +1,12 @@ ---- -description: The rmi command description and usage -keywords: -- remove, image, Docker -menu: - main: - parent: smn_cli -title: rmi ---- + # rmi diff --git a/engine/reference/commandline/run.md b/engine/reference/commandline/run.md index 542748c20b6..b169f9c4765 100644 --- a/engine/reference/commandline/run.md +++ b/engine/reference/commandline/run.md @@ -1,12 +1,12 @@ ---- -description: The run command description and usage -keywords: -- run, command, container -menu: - main: - parent: smn_cli -title: run ---- + # run @@ -76,7 +76,7 @@ Options: -m, --memory string Memory limit --memory-reservation string Memory soft limit --memory-swap string Swap limit equal to memory plus swap: '-1' to enable unlimited swap - --memory-swappiness int Tune container memory swappiness (0 to 100) (default -1). + --memory-swappiness int Tune container memory swappiness (0 to 100) (default -1) --name string Assign a name to the container --network-alias value Add network-scoped alias for the container (default []) --network string Connect a container to a network @@ -197,9 +197,9 @@ The `-w` lets the command being executed inside directory given, here $ 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. -User cannot pass a size less than the Default BaseFS Size. This option is only -available for the `devicemapper`, `btrfs`, and `zfs` graph drivers. +This (size) will allow to set the container rootfs size to 120G at creation time. +User cannot pass a size less than the Default BaseFS Size. This option is only +available for the `devicemapper`, `btrfs`, `windowsfilter`, and `zfs` graph drivers. ### Mount tmpfs (--tmpfs) @@ -614,6 +614,11 @@ The `--stop-signal` flag sets the system call signal that will be sent to the co 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`. + ### Specify isolation technology for container (--isolation) This option is useful in situations where you are running Docker containers on diff --git a/engine/reference/commandline/save.md b/engine/reference/commandline/save.md index 0fe8f022474..f7d1fdedcb8 100644 --- a/engine/reference/commandline/save.md +++ b/engine/reference/commandline/save.md @@ -1,12 +1,12 @@ ---- -description: The save command description and usage -keywords: -- tarred, repository, backup -menu: - main: - parent: smn_cli -title: save ---- + # save diff --git a/engine/reference/commandline/search.md b/engine/reference/commandline/search.md index 50d2514d89e..988db8bf1f4 100644 --- a/engine/reference/commandline/search.md +++ b/engine/reference/commandline/search.md @@ -1,12 +1,12 @@ ---- -description: The search command description and usage -keywords: -- search, hub, images -menu: - main: - parent: smn_cli -title: search ---- + # search @@ -80,7 +80,7 @@ at least 3 stars and the description isn't truncated in the output: ## Limit search results (--limit) -The flag `--limit` is the maximum number of results returned by a search. This value could +The flag `--limit` is the maximium number of results returned by a search. This value could be in the range between 1 and 100. The default value of `--limit` is 25. diff --git a/engine/reference/commandline/service_create.md b/engine/reference/commandline/service_create.md index f409ccad441..059996dadfd 100644 --- a/engine/reference/commandline/service_create.md +++ b/engine/reference/commandline/service_create.md @@ -1,14 +1,12 @@ ---- -description: The service create command description and usage -keywords: -- service, create -menu: - main: - parent: smn_cli -title: service create ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # service create @@ -22,6 +20,7 @@ Options: --container-label value Service container labels (default []) --endpoint-mode string Endpoint mode (vip or dnsrr) -e, --env value Set environment variables (default []) + --group-add value Add additional user groups to the container (default []) --help Print usage -l, --label value Service labels (default []) --limit-cpu value Limit CPUs (default 0.000) @@ -44,7 +43,7 @@ Options: --update-delay duration Delay between updates --update-failure-action string Action on update failure (pause|continue) (default "pause") --update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1) - -u, --user string Username or UID + -u, --user string Username or UID (format: [:]) --with-registry-auth Send registry authentication details to Swarm agents -w, --workdir string Working directory inside the container ``` @@ -175,41 +174,12 @@ For more information about named volumes, see The following table describes options which apply to both bind-mounts and named volumes in a service: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionRequiredDescription
typeThe type of mount, can be either volume, or bind. Defaults to volume if no type is specified.
  • volume: mounts a managed volume into the container.
  • bind: bind-mounts a directory or file from the host into the container.
src or sourcefor type=bind only
  • type=volume: src is an optional way to specify the name of the volume (for example, src=my-volume). If the named volume does not exist, it is automatically created. If no src is specified, the volume is assigned a random name which is guaranteed to be unique on the host, but may not be unique cluster-wide. A randomly-named volume has the same lifecycle as its container and is destroyed when the container is destroyed (which is upon service update, or when scaling or re-balancing the service).
  • type=bind: src is required, and specifies an absolute path to the file or directory to bind-mount (for example, src=/path/on/host/). An error is produced if the file or directory does not exist.
dst or destination or targetyesMount path inside the container, for example /some/path/in/container/. If the path does not exist in the container’s filesystem, the Engine creates a directory at the specified location before mounting the volume or bind-mount.
readonly or roThe Engine mounts binds and volumes read-write unless readonly option is given when mounting the bind or volume.

  • true or 1 or no value: Mounts the bind or volume read-only.
  • false or 0: Mounts the bind or volume read-write.
+| Option | Required | Description +|:-----------------------------------------|:--------------------------|:----------------------------------------------------------------------------------------- +| **type** | | The type of mount, can be either `volume`, or `bind`. Defaults to `volume` if no type is specified.
  • `volume`: mounts a [managed volume](volume_create.md) into the container.
  • `bind`: bind-mounts a directory or file from the host into the container.
+| **src** or **source** | for `type=bind` only |
  • `type=volume`: `src` is an optional way to specify the name of the volume (for example, `src=my-volume`). If the named volume does not exist, it is automatically created. If no `src` is specified, the volume is assigned a random name which is guaranteed to be unique on the host, but may not be unique cluster-wide. A randomly-named volume has the same lifecycle as its container and is destroyed when the *container* is destroyed (which is upon `service update`, or when scaling or re-balancing the service).
  • `type=bind`: `src` is required, and specifies an absolute path to the file or directory to bind-mount (for example, `src=/path/on/host/`). An error is produced if the file or directory does not exist.
+| **dst** or **destination** or **target** | yes | Mount path inside the container, for example `/some/path/in/container/`. If the path does not exist in the container's filesystem, the Engine creates a directory at the specified location before mounting the volume or bind-mount. +| **readonly** or **ro** | | The Engine mounts binds and volumes `read-write` unless `readonly` option is given when mounting the bind or volume.

  • `true` or `1` or no value: Mounts the bind or volume read-only.
  • `false` or `0`: Mounts the bind or volume read-write.
#### Bind Propagation @@ -251,37 +221,12 @@ For more information about bind propagation, see the #### Options for Named Volumes The following options can only be used for named volumes (`type=volume`); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
OptionDescription
volume-driverName of the volume-driver plugin to use for the volume. Defaults to "local", to use the local volume driver to create the volume if the volume does not exist.
volume-labelOne or more custom metadata (“labels”) to apply to the volume upon creation. For example, volume-label=mylabel=hello-world,my-other-label=hello-mars. For more information about labels, refer to apply custom metadata.
volume-nocopyBy default, if you attach an empty volume to a container, and files or directories already existed at the mount-path in the container (dst), the Engine copies those files and directories into the volume, allowing the host to access them. Set volume-nocopy to disables copying files from the container’s filesystem to the volume and mount the empty volume.

A value is optional:
  • true or 1: Default if you do not provide a value. Disables copying.
  • false or 0: Enables copying.
volume-optOptions specific to a given volume driver, which will be passed to the driver when creating the volume. Options are provided as a comma-separated list of key/value pairs, for example, volume-opt=some-option=some-value,some-other-option=some-other-value. For available options for a given driver, refer to that driver’s documentation.
- +| Option | Description +|:----------------------|:-------------------------------------------------------------------------------------------------------------------- +| **volume-driver** | Name of the volume-driver plugin to use for the volume. Defaults to ``"local"``, to use the local volume driver to create the volume if the volume does not exist. +| **volume-label** | One or more custom metadata ("labels") to apply to the volume upon creation. For example, `volume-label=mylabel=hello-world,my-other-label=hello-mars`. For more information about labels, refer to [apply custom metadata](../../userguide/labels-custom-metadata.md). +| **volume-nocopy** | By default, if you attach an empty volume to a container, and files or directories already existed at the mount-path in the container (`dst`), the Engine copies those files and directories into the volume, allowing the host to access them. Set `volume-nocopy` to disables copying files from the container's filesystem to the volume and mount the empty volume.

A value is optional:
  • `true` or `1`: Default if you do not provide a value. Disables copying.
  • `false` or `0`: Enables copying.
+| **volume-opt** | Options specific to a given volume driver, which will be passed to the driver when creating the volume. Options are provided as a comma-separated list of key/value pairs, for example, `volume-opt=some-option=some-value,some-other-option=some-other-value`. For available options for a given driver, refer to that driver's documentation. #### Differences between "--mount" and "--volume" diff --git a/engine/reference/commandline/service_inspect.md b/engine/reference/commandline/service_inspect.md index 53e2e838fd9..e24927f433b 100644 --- a/engine/reference/commandline/service_inspect.md +++ b/engine/reference/commandline/service_inspect.md @@ -1,14 +1,12 @@ ---- -description: The service inspect command description and usage -keywords: -- service, inspect -menu: - main: - parent: smn_cli -title: service inspect ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # service inspect @@ -117,7 +115,7 @@ ID: c8wgl7q4ndfd52ni6qftkvnnp Name: frontend Labels: - org.example.projectname=demo-app -Mode: REPLICATED +Service Mode: REPLICATED Replicas: 5 Placement: UpdateConfig: @@ -125,6 +123,7 @@ UpdateConfig: ContainerSpec: Image: nginx:alpine Resources: +Endpoint Mode: vip Ports: Name = Protocol = tcp @@ -132,6 +131,8 @@ Ports: PublishedPort = 4443 ``` +You can also use `--format pretty` for the same effect. + ### Finding the number of tasks running as part of a service @@ -139,10 +140,10 @@ The `--format` option can be used to obtain specific information about a service. For example, the following command outputs the number of replicas of the "redis" service. -```bash{% raw %} +```bash $ docker service inspect --format='{{.Spec.Mode.Replicated.Replicas}}' redis 10 -{% endraw %}``` +``` ## Related information diff --git a/engine/reference/commandline/service_ls.md b/engine/reference/commandline/service_ls.md index ee41c513826..68c3ade6ce7 100644 --- a/engine/reference/commandline/service_ls.md +++ b/engine/reference/commandline/service_ls.md @@ -1,14 +1,12 @@ ---- -description: The service ls command description and usage -keywords: -- service, ls -menu: - main: - parent: smn_cli -title: service ls ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # service ls @@ -47,9 +45,9 @@ than one filter, then pass multiple flags (e.g., `--filter "foo=bar" --filter "b The currently supported filters are: -* [id](service_ls.md#id) -* [label](service_ls.md#label) -* [name](service_ls.md#name) +* [id](#id) +* [label](#label) +* [name](#name) #### ID diff --git a/engine/reference/commandline/service_ps.md b/engine/reference/commandline/service_ps.md index 8536de6cb50..d6f9de5f279 100644 --- a/engine/reference/commandline/service_ps.md +++ b/engine/reference/commandline/service_ps.md @@ -1,17 +1,13 @@ ---- -aliases: -- /engine/reference/commandline/service_tasks/ -description: The service ps command description and usage -keywords: -- service, tasks -- ps -menu: - main: - parent: smn_cli -title: service ps ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # service ps @@ -25,6 +21,7 @@ Options: -f, --filter value Filter output based on conditions provided --help Print usage --no-resolve Do not map IDs to Names + --no-trunc Do not truncate output ``` Lists the tasks that are running as part of the specified service. This command @@ -39,17 +36,17 @@ The following command shows all the tasks that are part of the `redis` service: ```bash $ docker service ps redis -ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE -0qihejybwf1x5vqi8lgzlgnpq redis.1 redis redis:3.0.6 Running 8 seconds Running manager1 -bk658fpbex0d57cqcwoe3jthu redis.2 redis redis:3.0.6 Running 9 seconds Running worker2 -5ls5s5fldaqg37s9pwayjecrf redis.3 redis redis:3.0.6 Running 9 seconds Running worker1 -8ryt076polmclyihzx67zsssj redis.4 redis redis:3.0.6 Running 9 seconds Running worker1 -1x0v8yomsncd6sbvfn0ph6ogc redis.5 redis redis:3.0.6 Running 8 seconds Running manager1 -71v7je3el7rrw0osfywzs0lko redis.6 redis redis:3.0.6 Running 9 seconds Running worker2 -4l3zm9b7tfr7cedaik8roxq6r redis.7 redis redis:3.0.6 Running 9 seconds Running worker2 -9tfpyixiy2i74ad9uqmzp1q6o redis.8 redis redis:3.0.6 Running 9 seconds Running worker1 -3w1wu13yuplna8ri3fx47iwad redis.9 redis redis:3.0.6 Running 8 seconds Running manager1 -8eaxrb2fqpbnv9x30vr06i6vt redis.10 redis redis:3.0.6 Running 8 seconds Running manager1 +NAME IMAGE NODE DESIRED STATE CURRENT STATE +redis.1.0qihejybwf1x5vqi8lgzlgnpq redis:3.0.6 manager1 Running Running 8 seconds +redis.2.bk658fpbex0d57cqcwoe3jthu redis:3.0.6 worker2 Running Running 9 seconds +redis.3.5ls5s5fldaqg37s9pwayjecrf redis:3.0.6 worker1 Running Running 9 seconds +redis.4.8ryt076polmclyihzx67zsssj redis:3.0.6 worker1 Running Running 9 seconds +redis.5.1x0v8yomsncd6sbvfn0ph6ogc redis:3.0.6 manager1 Running Running 8 seconds +redis.6.71v7je3el7rrw0osfywzs0lko redis:3.0.6 worker2 Running Running 9 seconds +redis.7.4l3zm9b7tfr7cedaik8roxq6r redis:3.0.6 worker2 Running Running 9 seconds +redis.8.9tfpyixiy2i74ad9uqmzp1q6o redis:3.0.6 worker1 Running Running 9 seconds +redis.9.3w1wu13yuplna8ri3fx47iwad redis:3.0.6 manager1 Running Running 8 seconds +redis.10.8eaxrb2fqpbnv9x30vr06i6vt redis:3.0.6 manager1 Running Running 8 seconds ``` @@ -62,9 +59,10 @@ Multiple filter flags are combined as an `OR` filter. For example, The currently supported filters are: -* [id](service_ps.md#id) -* [name](service_ps.md#name) -* [desired-state](service_ps.md#desired-state) +* [id](#id) +* [name](#name) +* [node](#node) +* [desired-state](#desired-state) #### ID @@ -73,9 +71,9 @@ The `id` filter matches on all or a prefix of a task's ID. ```bash $ docker service ps -f "id=8" redis -ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE -8ryt076polmclyihzx67zsssj redis.4 redis redis:3.0.6 Running 4 minutes Running worker1 -8eaxrb2fqpbnv9x30vr06i6vt redis.10 redis redis:3.0.6 Running 4 minutes Running manager1 +NAME IMAGE NODE DESIRED STATE CURRENT STATE +redis.4.8ryt076polmclyihzx67zsssj redis:3.0.6 worker1 Running Running 9 seconds +redis.10.8eaxrb2fqpbnv9x30vr06i6vt redis:3.0.6 manager1 Running Running 8 seconds ``` #### Name @@ -84,8 +82,22 @@ The `name` filter matches on task names. ```bash $ docker service ps -f "name=redis.1" redis -ID NAME SERVICE IMAGE DESIRED STATE LAST STATE NODE -0qihejybwf1x5vqi8lgzlgnpq redis.1 redis redis:3.0.6 Running Running 8 seconds manager1 +NAME IMAGE NODE DESIRED STATE CURRENT STATE +redis.1.0qihejybwf1x5vqi8lgzlgnpq redis:3.0.6 manager1 Running Running 8 seconds +``` + + +#### Node + +The `node` filter matches on a node name or a node ID. + +```bash +$ docker service ps -f "node=manager1" redis +NAME IMAGE NODE DESIRED STATE CURRENT STATE +redis.1.0qihejybwf1x5vqi8lgzlgnpq redis:3.0.6 manager1 Running Running 8 seconds +redis.5.1x0v8yomsncd6sbvfn0ph6ogc redis:3.0.6 manager1 Running Running 8 seconds +redis.9.3w1wu13yuplna8ri3fx47iwad redis:3.0.6 manager1 Running Running 8 seconds +redis.10.8eaxrb2fqpbnv9x30vr06i6vt redis:3.0.6 manager1 Running Running 8 seconds ``` diff --git a/engine/reference/commandline/service_rm.md b/engine/reference/commandline/service_rm.md index 2c732c7fca2..edd9b417ed1 100644 --- a/engine/reference/commandline/service_rm.md +++ b/engine/reference/commandline/service_rm.md @@ -1,19 +1,17 @@ ---- -description: The service rm command description and usage -keywords: -- service, rm -menu: - main: - parent: smn_cli -title: service rm ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # service rm ```Markdown -Usage: docker service rm [OPTIONS] SERVICE [SERVICE...] +Usage: docker service rm SERVICE [SERVICE...] Remove one or more services diff --git a/engine/reference/commandline/service_scale.md b/engine/reference/commandline/service_scale.md index 876644c7ecb..f4356945e56 100644 --- a/engine/reference/commandline/service_scale.md +++ b/engine/reference/commandline/service_scale.md @@ -1,14 +1,12 @@ ---- -description: The service scale command description and usage -keywords: -- service, scale -menu: - main: - parent: smn_cli -title: service scale ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # service scale diff --git a/engine/reference/commandline/service_update.md b/engine/reference/commandline/service_update.md index 215354bcbe7..dd65bb288ff 100644 --- a/engine/reference/commandline/service_update.md +++ b/engine/reference/commandline/service_update.md @@ -1,14 +1,12 @@ ---- -description: The service update command description and usage -keywords: -- service, update -menu: - main: - parent: smn_cli -title: service update ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # service update @@ -26,6 +24,8 @@ Options: --endpoint-mode string Endpoint mode (vip or dnsrr) --env-add value Add or update environment variables (default []) --env-rm value Remove an environment variable (default []) + --group-add value Add additional user groups to the container (default []) + --group-rm value Remove previously added user groups from the container (default []) --help Print usage --image string Service image tag --label-add value Add or update service labels (default []) @@ -50,7 +50,7 @@ Options: --update-delay duration Delay between updates --update-failure-action string Action on update failure (pause|continue) (default "pause") --update-parallelism uint Maximum number of tasks updated simultaneously (0 to update all at once) (default 1) - -u, --user string Username or UID + -u, --user string Username or UID (format: [:]) --with-registry-auth Send registry authentication details to Swarm agents -w, --workdir string Working directory inside the container ``` diff --git a/engine/reference/commandline/stack_config.md b/engine/reference/commandline/stack_config.md index c866d6769e0..9a39d271160 100644 --- a/engine/reference/commandline/stack_config.md +++ b/engine/reference/commandline/stack_config.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: The stack config command description and usage -keywords: -- stack, config -menu: - main: - parent: smn_cli -title: stack config ---- + # stack config (experimental) @@ -29,3 +29,4 @@ Displays the configuration of a stack. * [stack rm](stack_rm.md) * [stack services](stack_services.md) * [stack tasks](stack_tasks.md) +* [stack ls](stack_ls.md) diff --git a/engine/reference/commandline/stack_deploy.md b/engine/reference/commandline/stack_deploy.md index 9254db6c157..bcafb7f6868 100644 --- a/engine/reference/commandline/stack_deploy.md +++ b/engine/reference/commandline/stack_deploy.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: The stack deploy command description and usage -keywords: -- stack, deploy, up -menu: - main: - parent: smn_cli -title: stack deploy ---- + # stack deploy (experimental) @@ -58,3 +58,4 @@ axqh55ipl40h vossibility-stack_vossibility-collector 1 icecrime/vossibility-co * [stack rm](stack_rm.md) * [stack services](stack_services.md) * [stack tasks](stack_tasks.md) +* [stack ls](stack_ls.md) diff --git a/engine/reference/commandline/stack_ls.md b/engine/reference/commandline/stack_ls.md new file mode 100644 index 00000000000..11abc347272 --- /dev/null +++ b/engine/reference/commandline/stack_ls.md @@ -0,0 +1,37 @@ + + +# stack ls (experimental) + +```markdown +Usage: docker stack ls + +List stacks +``` + +Lists the stacks. + +For example, the following command shows all stacks and some additional information: + +```bash +$ docker stack ls + +ID SERVICES +vossibility-stack 6 +myapp 2 +``` + +## Related information + +* [stack config](stack_config.md) +* [stack deploy](stack_deploy.md) +* [stack rm](stack_rm.md) +* [stack tasks](stack_tasks.md) diff --git a/engine/reference/commandline/stack_rm.md b/engine/reference/commandline/stack_rm.md index d3e60adb8c1..5d4e4d57be2 100644 --- a/engine/reference/commandline/stack_rm.md +++ b/engine/reference/commandline/stack_rm.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: The stack rm command description and usage -keywords: -- stack, rm, remove, down -menu: - main: - parent: smn_cli -title: stack rm ---- + # stack rm (experimental) @@ -32,3 +32,4 @@ a manager node. * [stack deploy](stack_deploy.md) * [stack services](stack_services.md) * [stack tasks](stack_tasks.md) +* [stack ls](stack_ls.md) diff --git a/engine/reference/commandline/stack_services.md b/engine/reference/commandline/stack_services.md index 8a400b2ba30..8f28410bf3b 100644 --- a/engine/reference/commandline/stack_services.md +++ b/engine/reference/commandline/stack_services.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: The stack services command description and usage -keywords: -- stack, services -menu: - main: - parent: smn_cli -title: stack services ---- + # stack services (experimental) @@ -63,3 +63,4 @@ The currently supported filters are: * [stack deploy](stack_deploy.md) * [stack rm](stack_rm.md) * [stack tasks](stack_tasks.md) +* [stack ls](stack_ls.md) diff --git a/engine/reference/commandline/stack_tasks.md b/engine/reference/commandline/stack_tasks.md index ddcfa19c437..24b00e69ccd 100644 --- a/engine/reference/commandline/stack_tasks.md +++ b/engine/reference/commandline/stack_tasks.md @@ -1,13 +1,13 @@ ---- -advisory: experimental -description: The stack tasks command description and usage -keywords: -- stack, tasks -menu: - main: - parent: smn_cli -title: stack tasks ---- + # stack tasks (experimental) @@ -35,9 +35,9 @@ Multiple filter flags are combined as an `OR` filter. For example, The currently supported filters are: -* [id](stack_tasks.md#id) -* [name](stack_tasks.md#name) -* [desired-state](stack_tasks.md#desired-state) +* [id](#id) +* [name](#name) +* [desired-state](#desired-state) ## Related information @@ -45,3 +45,4 @@ The currently supported filters are: * [stack deploy](stack_deploy.md) * [stack rm](stack_rm.md) * [stack services](stack_services.md) +* [stack ls](stack_ls.md) diff --git a/engine/reference/commandline/start.md b/engine/reference/commandline/start.md index 4d462cd9637..72ff7e1002a 100644 --- a/engine/reference/commandline/start.md +++ b/engine/reference/commandline/start.md @@ -1,12 +1,12 @@ ---- -description: The start command description and usage -keywords: -- Start, container, stopped -menu: - main: - parent: smn_cli -title: start ---- + # start diff --git a/engine/reference/commandline/stats.md b/engine/reference/commandline/stats.md index 091ca393f40..d6d6ed0e1fc 100644 --- a/engine/reference/commandline/stats.md +++ b/engine/reference/commandline/stats.md @@ -1,12 +1,12 @@ ---- -description: The stats command description and usage -keywords: -- container, resource, statistics -menu: - main: - parent: smn_cli -title: stats ---- + # stats @@ -23,11 +23,11 @@ Options: 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. +If you want more detailed information about a container's resource usage, use the `/containers/(id)/stats` API endpoint. ## Examples -Running `docker stats` on all running containers +Running `docker stats` on all running containers against a Linux daemon. $ docker stats CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O @@ -35,9 +35,75 @@ Running `docker stats` on all running containers 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. +Running `docker stats` on multiple containers by name and id against a Linux daemon. $ docker stats fervent_panini 5acfcb1b4fd1 - CONTAINER CPU % MEM USAGE/LIMIT MEM % NET I/O + 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. + + 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. + + 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 +`.CPUPerc` | CPU percentage +`.MemUsage` | Memory usage +`.NetIO` | Network IO +`.BlockIO` | Block IO +`.MemPerc` | Memory percentage (Not available on Windows) +`.PIDs` | Number of PIDs (Not available on Windows) + + +When using the `--format` option, the `stats` command either +outputs the data exactly as the template declares or, when using the +`table` directive, includes column headers as well. + +The following example uses a template without headers and outputs the +`Container` and `CPUPerc` entries separated by a colon for all images: + +```bash +$ docker stats --format "{{.Container}}: {{.CPUPerc}}" + +09d3bb5b1604: 6.61% +9db7aa4d986d: 9.19% +3f214c61ad1d: 0.00% +``` + +To list all containers statistics with their name, CPU percentage and memory +usage in a table format you can use: + +```bash +$ docker stats --format "table {{.Container}}\t{{.CPUPerc}}\t{{.MemUsage}}" + +CONTAINER CPU % PRIV WORKING SET +1285939c1fd3 0.07% 796 KiB / 64 MiB +9c76f7834ae2 0.07% 2.746 MiB / 64 MiB +d1ea048f04e4 0.03% 4.583 MiB / 64 MiB +``` diff --git a/engine/reference/commandline/stop.md b/engine/reference/commandline/stop.md index 0c2fe38a819..662255846f8 100644 --- a/engine/reference/commandline/stop.md +++ b/engine/reference/commandline/stop.md @@ -1,12 +1,12 @@ ---- -description: The stop command description and usage -keywords: -- stop, SIGKILL, SIGTERM -menu: - main: - parent: smn_cli -title: stop ---- + # stop diff --git a/engine/reference/commandline/swarm_init.md b/engine/reference/commandline/swarm_init.md index bf6f19c036e..6df0cdb1d06 100644 --- a/engine/reference/commandline/swarm_init.md +++ b/engine/reference/commandline/swarm_init.md @@ -1,14 +1,12 @@ ---- -description: The swarm init command description and usage -keywords: -- swarm, init -menu: - main: - parent: smn_cli -title: swarm init ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # swarm init diff --git a/engine/reference/commandline/swarm_join.md b/engine/reference/commandline/swarm_join.md index 765c77f5809..c0a7d91cc3e 100644 --- a/engine/reference/commandline/swarm_join.md +++ b/engine/reference/commandline/swarm_join.md @@ -1,14 +1,12 @@ ---- -description: The swarm join command description and usage -keywords: -- swarm, join -menu: - main: - parent: smn_cli -title: swarm join ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # swarm join diff --git a/engine/reference/commandline/swarm_join_token.md b/engine/reference/commandline/swarm_join_token.md index 0248ab3e57b..f808d84244f 100644 --- a/engine/reference/commandline/swarm_join_token.md +++ b/engine/reference/commandline/swarm_join_token.md @@ -1,17 +1,17 @@ ---- -description: The swarm join-token command description and usage -keywords: -- swarm, join-token -menu: - main: - parent: smn_cli -title: swarm join-token ---- + # swarm join-token ```markdown -Usage: docker swarm join-token [--rotate] (worker|manager) +Usage: docker swarm join-token [OPTIONS] (worker|manager) Manage join tokens diff --git a/engine/reference/commandline/swarm_leave.md b/engine/reference/commandline/swarm_leave.md index d350b003516..112813466bb 100644 --- a/engine/reference/commandline/swarm_leave.md +++ b/engine/reference/commandline/swarm_leave.md @@ -1,14 +1,12 @@ ---- -description: The swarm leave command description and usage -keywords: -- swarm, leave -menu: - main: - parent: smn_cli -title: swarm leave ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # swarm leave diff --git a/engine/reference/commandline/swarm_update.md b/engine/reference/commandline/swarm_update.md index e4424c255c3..5299be257df 100644 --- a/engine/reference/commandline/swarm_update.md +++ b/engine/reference/commandline/swarm_update.md @@ -1,14 +1,12 @@ ---- -description: The swarm update command description and usage -keywords: -- swarm, update -menu: - main: - parent: smn_cli -title: swarm update ---- - -**Warning:** this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes. + # swarm update diff --git a/engine/reference/commandline/system_df.md b/engine/reference/commandline/system_df.md new file mode 100644 index 00000000000..9f03dc8250b --- /dev/null +++ b/engine/reference/commandline/system_df.md @@ -0,0 +1,68 @@ + + +# system df + +```markdown +Usage: docker system df [OPTIONS] + +Show docker filesystem usage + +Options: + --help Print usage + -v, --verbose Show detailed information on space usage +``` + +The `docker system df` command displays information regarding the +amount of disk space used by the docker daemon. + +By default the command will just show a summary of the data used: +```bash +$ docker system df +TYPE TOTAL ACTIVE SIZE RECLAIMABLE +Images 5 2 16.43 MB 11.63 MB (70%) +Containers 2 0 212 B 212 B (100%) +Local Volumes 2 1 36 B 0 B (0%) +``` + +A more detailed view can be requested using the `-v, --verbose` flag: +```bash +$ docker system df -v +Images space usage: + +REPOSITORY TAG IMAGE ID CREATED SIZE SHARED SIZE UNIQUE SIZE CONTAINERS +my-curl latest b2789dd875bf 6 minutes ago 11 MB 11 MB 5 B 0 +my-jq latest ae67841be6d0 6 minutes ago 9.623 MB 8.991 MB 632.1 kB 0 + a0971c4015c1 6 minutes ago 11 MB 11 MB 0 B 0 +alpine latest 4e38e38c8ce0 9 weeks ago 4.799 MB 0 B 4.799 MB 1 +alpine 3.3 47cf20d8c26c 9 weeks ago 4.797 MB 4.797 MB 0 B 1 + +Containers space usage: + +CONTAINER ID IMAGE COMMAND LOCAL VOLUMES SIZE CREATED STATUS NAMES +4a7f7eebae0f alpine:latest "sh" 1 0 B 16 minutes ago Exited (0) 5 minutes ago hopeful_yalow +f98f9c2aa1ea alpine:3.3 "sh" 1 212 B 16 minutes ago Exited (0) 48 seconds ago anon-vol + +Local Volumes space usage: + +NAME LINKS SIZE +07c7bdf3e34ab76d921894c2b834f073721fccfbbcba792aa7648e3a7a664c2e 2 36 B +my-named-vol 0 0 B +``` + +* `SHARED SIZE` is the amount of space that an image shares with another one (i.e. their common data) +* `UNIQUE SIZE` is the amount of space that is only used by a given image +* `SIZE` is the virtual size of the image, it is the sum of `SHARED SIZE` and `UNIQUE SIZE` + +## Related Information +* [system prune](system_prune.md) +* [container prune](container_prune.md) +* [volume prune](volume_prune.md) +* [image prune](image_prune.md) diff --git a/engine/reference/commandline/system_prune.md b/engine/reference/commandline/system_prune.md new file mode 100644 index 00000000000..3ba73ee8182 --- /dev/null +++ b/engine/reference/commandline/system_prune.md @@ -0,0 +1,70 @@ + + +# system prune + +```markdown +Usage: docker system prune [OPTIONS] + +Delete unused data + +Options: + -a, --all Remove all unused images not just dangling ones + -f, --force Do not prompt for confirmation + --help Print usage +``` + +Remove all unused containers, volumes and images (both dangling and unreferenced). + +Example output: + +```bash +$ docker system prune -a +WARNING! This will remove: + - all stopped containers + - all volumes not used by at least one container + - all images without at least one container associated to them +Are you sure you want to continue? [y/N] y +Deleted Containers:0998aa37185a1a7036b0e12cf1ac1b6442dcfa30a5c9650a42ed5010046f195b +73958bfb884fa81fa4cc6baf61055667e940ea2357b4036acbbe25a60f442a4d + +Deleted Volumes: +named-vol + +Deleted Images: +untagged: my-curl:latest +deleted: sha256:7d88582121f2a29031d92017754d62a0d1a215c97e8f0106c586546e7404447d +deleted: sha256:dd14a93d83593d4024152f85d7c63f76aaa4e73e228377ba1d130ef5149f4d8b +untagged: alpine:3.3 +deleted: sha256:695f3d04125db3266d4ab7bbb3c6b23aa4293923e762aa2562c54f49a28f009f +untagged: alpine:latest +deleted: sha256:ee4603260daafe1a8c2f3b78fd760922918ab2441cbb2853ed5c439e59c52f96 +deleted: sha256:9007f5987db353ec398a223bc5a135c5a9601798ba20a1abba537ea2f8ac765f +deleted: sha256:71fa90c8f04769c9721459d5aa0936db640b92c8c91c9b589b54abd412d120ab +deleted: sha256:bb1c3357b3c30ece26e6604aea7d2ec0ace4166ff34c3616701279c22444c0f3 +untagged: my-jq:latest +deleted: sha256:6e66d724542af9bc4c4abf4a909791d7260b6d0110d8e220708b09e4ee1322e1 +deleted: sha256:07b3fa89d4b17009eb3988dfc592c7d30ab3ba52d2007832dffcf6d40e3eda7f +deleted: sha256:3a88a5c81eb5c283e72db2dbc6d65cbfd8e80b6c89bb6e714cfaaa0eed99c548 + +Total reclaimed space: 13.5 MB +``` + +## Related information + +* [volume create](volume_create.md) +* [volume ls](volume_ls.md) +* [volume inspect](volume_inspect.md) +* [volume rm](volume_rm.md) +* [Understand Data Volumes](../../tutorials/dockervolumes.md) +* [system df](system_df.md) +* [container prune](container_prune.md) +* [image prune](image_prune.md) +* [system prune](system_prune.md) diff --git a/engine/reference/commandline/tag.md b/engine/reference/commandline/tag.md index 7c066086285..60692958f1f 100644 --- a/engine/reference/commandline/tag.md +++ b/engine/reference/commandline/tag.md @@ -1,12 +1,12 @@ ---- -description: The tag command description and usage -keywords: -- tag, name, image -menu: - main: - parent: smn_cli -title: tag ---- + # tag diff --git a/engine/reference/commandline/top.md b/engine/reference/commandline/top.md index 1b10e1d78b3..291f96ce093 100644 --- a/engine/reference/commandline/top.md +++ b/engine/reference/commandline/top.md @@ -1,12 +1,12 @@ ---- -description: The top command description and usage -keywords: -- container, running, processes -menu: - main: - parent: smn_cli -title: top ---- + # top diff --git a/engine/reference/commandline/unpause.md b/engine/reference/commandline/unpause.md index 21efca77a90..e5c9d506e04 100644 --- a/engine/reference/commandline/unpause.md +++ b/engine/reference/commandline/unpause.md @@ -1,12 +1,12 @@ ---- -description: The unpause command description and usage -keywords: -- cgroups, suspend, container -menu: - main: - parent: smn_cli -title: unpause ---- + # unpause diff --git a/engine/reference/commandline/update.md b/engine/reference/commandline/update.md index 7323b2d1efe..bacecd0106e 100644 --- a/engine/reference/commandline/update.md +++ b/engine/reference/commandline/update.md @@ -1,12 +1,12 @@ ---- -description: The update command description and usage -keywords: -- resources, update, dynamically -menu: - main: - parent: smn_cli -title: update ---- + ## update @@ -31,30 +31,25 @@ Options: ``` 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. +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` value, you can specify these -options on a running or a stopped container. You can only update -`--kernel-memory` on a stopped container. When you run `docker update` on -stopped container, the next time you restart it, the container uses those -values. - -Another configuration you can change with this command is restart policy, -new restart policy will take effect instantly after you run `docker update` -on a container. +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. ## Examples The following sections illustrate ways to use this command. -### Update a container with cpu-shares=512 +### 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: +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 @@ -68,9 +63,51 @@ To update multiple resource configurations for multiple containers: $ 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/engine/reference/commandline/version.md b/engine/reference/commandline/version.md index c1b2ba6bac5..e650e41a2d1 100644 --- a/engine/reference/commandline/version.md +++ b/engine/reference/commandline/version.md @@ -1,12 +1,12 @@ ---- -description: The version command description and usage -keywords: -- version, architecture, api -menu: - main: - parent: smn_cli -title: version ---- + # version @@ -49,14 +49,10 @@ describes all the details of the format. **Get server version:** - {% raw %} $ docker version --format '{{.Server.Version}}' 1.8.0 - {% endraw %} **Dump raw data:** - {% 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/engine/reference/commandline/volume_create.md b/engine/reference/commandline/volume_create.md index b8adf0d3e11..65dbba2f641 100644 --- a/engine/reference/commandline/volume_create.md +++ b/engine/reference/commandline/volume_create.md @@ -1,17 +1,17 @@ ---- -description: The volume create command description and usage -keywords: -- volume, create -menu: - main: - parent: smn_cli -title: volume create ---- + # volume create ```markdown -Usage: docker volume create [OPTIONS] +Usage: docker volume create [OPTIONS] [VOLUME] Create a volume @@ -19,14 +19,13 @@ Options: -d, --driver string Specify volume driver name (default "local") --help Print usage --label value Set metadata for a volume (default []) - --name string Specify volume name -o, --opt value Set driver specific options (default map[]) ``` 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: ```bash -$ docker volume create --name hello +$ docker volume create hello hello $ docker run -d -v hello:/world busybox ls /world @@ -62,19 +61,19 @@ The built-in `local` driver on Linux accepts options similar to the linux `mount For example, the following creates a `tmpfs` volume called `foo` with a size of 100 megabyte and `uid` of 1000. ```bash -$ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 --name foo +$ docker volume create --driver local --opt type=tmpfs --opt device=tmpfs --opt o=size=100m,uid=1000 foo ``` Another example that uses `btrfs`: ```bash -$ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 --name foo +$ docker volume create --driver local --opt type=btrfs --opt device=/dev/sda2 foo ``` Another example that uses `nfs` to mount the `/path/to/dir` in `rw` mode from `192.168.1.1`: ```bash -$ docker volume create --driver local --opt type=nfs --opt o=addr=192.168.1.1,rw --opt device=:/path/to/dir --name foo +$ docker volume create --driver local --opt type=nfs --opt o=addr=192.168.1.1,rw --opt device=:/path/to/dir foo ``` diff --git a/engine/reference/commandline/volume_inspect.md b/engine/reference/commandline/volume_inspect.md index aa13773d185..fac9438e3d3 100644 --- a/engine/reference/commandline/volume_inspect.md +++ b/engine/reference/commandline/volume_inspect.md @@ -1,12 +1,12 @@ ---- -description: The volume inspect command description and usage -keywords: -- volume, inspect -menu: - main: - parent: smn_cli -title: volume inspect ---- + # volume inspect @@ -40,10 +40,8 @@ Example output: } ] - {% raw %} $ docker volume inspect --format '{{ .Mountpoint }}' 85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d /var/lib/docker/volumes/85bffb0677236974f93955d8ecc4df55ef5070117b0e53333cc1b443777be24d/_data - {% endraw %} ## Related information diff --git a/engine/reference/commandline/volume_ls.md b/engine/reference/commandline/volume_ls.md index 0712de9d5d9..34e2ae927d4 100644 --- a/engine/reference/commandline/volume_ls.md +++ b/engine/reference/commandline/volume_ls.md @@ -1,12 +1,12 @@ ---- -description: The volume ls command description and usage -keywords: -- volume, list -menu: - main: - parent: smn_cli -title: volume ls ---- + # volume ls @@ -19,26 +19,30 @@ Aliases: ls, list Options: - -f, --filter value Provide filter values (i.e. 'dangling=true') (default []) + -f, --filter value Provide filter values (e.g. 'dangling=true') (default []) - dangling= a volume if referenced or not - driver= a volume's driver name + - label= or label== - name= a volume's name + --format string Pretty-print volumes using a Go template --help Print usage -q, --quiet Only display volume names ``` -Lists all the volumes Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](volume_ls.md#filtering) section for more information about available filter options. +Lists all the volumes Docker knows about. You can filter using the `-f` or `--filter` flag. Refer to the [filtering](#filtering) section for more information about available filter options. Example output: - $ docker volume create --name rosemary - rosemary - $docker volume create --name tyler - tyler - $ docker volume ls - DRIVER VOLUME NAME - local rosemary - local tyler +```bash +$ docker volume create rosemary +rosemary +$docker volume create tyler +tyler +$ docker volume ls +DRIVER VOLUME NAME +local rosemary +local tyler +``` ## Filtering @@ -49,17 +53,21 @@ The currently supported filters are: * dangling (boolean - true or false, 0 or 1) * driver (a volume driver's name) +* label (`label=` or `label==`) * name (a volume's name) ### dangling The `dangling` filter matches on all volumes not referenced by any containers - $ docker run -d -v tyler:/tmpwork busybox - f86a7dd02898067079c99ceacd810149060a70528eff3754d0b0f1a93bd0af18 - $ docker volume ls -f dangling=true - DRIVER VOLUME NAME - local rosemary +```bash +$ docker run -d -v tyler:/tmpwork busybox + +f86a7dd02898067079c99ceacd810149060a70528eff3754d0b0f1a93bd0af18 +$ docker volume ls -f dangling=true +DRIVER VOLUME NAME +local rosemary +``` ### driver @@ -67,10 +75,59 @@ The `driver` filter matches on all or part of a volume's driver name. The following filter matches all volumes with a driver name containing the `local` string. - $ docker volume ls -f driver=local - DRIVER VOLUME NAME - local rosemary - local tyler +```bash +$ docker volume ls -f driver=local + +DRIVER VOLUME NAME +local rosemary +local tyler +``` + +#### Label + +The `label` filter matches volumes based on the presence of a `label` alone or +a `label` and a value. + +First, let's create some volumes to illustrate this; + +```bash +$ docker volume create the-doctor --label is-timelord=yes +the-doctor +$ docker volume create daleks --label is-timelord=no +daleks +``` + +The following example filter matches volumes with the `is-timelord` label +regardless of its value. + +```bash +$ docker volume ls --filter label=is-timelord + +DRIVER NAME +local daleks +local the-doctor +``` + +As can be seen in the above example, both volumes with `is-timelord=yes`, and +`is-timelord=no` are returned. + +Filtering on both `key` *and* `value` of the label, produces the expected result: + +```bash +$ docker volume ls --filter label=is-timelord=yes + +DRIVER NAME +local the-doctor +``` + +Specifying multiple label filter produces an "and" search; all conditions +should be met; + +```bash +$ docker volume ls --filter label=is-timelord=yes --filter label=is-timelord=no + +DRIVER NAME +``` ### name @@ -82,6 +139,36 @@ The following filter matches all volumes with a name containing the `rose` strin DRIVER VOLUME NAME local rosemary +## Formatting + +The formatting options (`--format`) pretty-prints volumes output +using a Go template. + +Valid placeholders for the Go template are listed below: + +Placeholder | Description +--------------|------------------------------------------------------------------------------------------ +`.Name` | Network name +`.Driver` | Network driver +`.Scope` | Network scope (local, global) +`.Mountpoint` | Whether the network is internal or not. +`.Labels` | All labels assigned to the volume. +`.Label` | Value of a specific label for this volume. For example `{{.Label "project.version"}}` + +When using the `--format` option, the `volume ls` command will either +output the data exactly as the template declares or, when using the +`table` directive, includes column headers as well. + +The following example uses a template without headers and outputs the +`Name` and `Driver` entries separated by a colon for all volumes: + +```bash +$ docker volume ls --format "{{.Name}}: {{.Driver}}" +vol1: local +vol2: local +vol3: local +``` + ## Related information * [volume create](volume_create.md) diff --git a/engine/reference/commandline/volume_prune.md b/engine/reference/commandline/volume_prune.md new file mode 100644 index 00000000000..4c6eab0d535 --- /dev/null +++ b/engine/reference/commandline/volume_prune.md @@ -0,0 +1,48 @@ + + +# volume prune + +```markdown +Usage: docker volume prune [OPTIONS] + +Remove all unused volumes + +Options: + -f, --force Do not prompt for confirmation + --help Print usage +``` + +Remove all unused volumes. Unused volumes are those which are not referenced by any containers + +Example output: + +```bash +$ docker volume prune +WARNING! This will remove all volumes not used by at least one container. +Are you sure you want to continue? [y/N] y +Deleted Volumes: +07c7bdf3e34ab76d921894c2b834f073721fccfbbcba792aa7648e3a7a664c2e +my-named-vol + +Total reclaimed space: 36 B +``` + +## Related information + +* [volume create](volume_create.md) +* [volume ls](volume_ls.md) +* [volume inspect](volume_inspect.md) +* [volume rm](volume_rm.md) +* [Understand Data Volumes](../../tutorials/dockervolumes.md) +* [system df](system_df.md) +* [container prune](container_prune.md) +* [image prune](image_prune.md) +* [system prune](system_prune.md) diff --git a/engine/reference/commandline/volume_rm.md b/engine/reference/commandline/volume_rm.md index 28d2991f8c0..aa66684259c 100644 --- a/engine/reference/commandline/volume_rm.md +++ b/engine/reference/commandline/volume_rm.md @@ -1,17 +1,17 @@ ---- -description: the volume rm command description and usage -keywords: -- volume, rm -menu: - main: - parent: smn_cli -title: volume rm ---- + # volume rm ```markdown -Usage: docker volume rm VOLUME [VOLUME...] +Usage: docker volume rm [OPTIONS] VOLUME [VOLUME...] Remove one or more volumes @@ -19,6 +19,7 @@ Aliases: rm, remove Options: + -f, --force Force the removal of one or more volumes --help Print usage ``` diff --git a/engine/reference/commandline/wait.md b/engine/reference/commandline/wait.md index 4dca7ebf706..b6fd68dbdb9 100644 --- a/engine/reference/commandline/wait.md +++ b/engine/reference/commandline/wait.md @@ -1,19 +1,19 @@ ---- -description: The wait command description and usage -keywords: -- container, stop, wait -menu: - main: - parent: smn_cli -title: wait ---- + # wait ```markdown Usage: docker wait CONTAINER [CONTAINER...] -Block until a container stops, then print its exit code +Block until one or more containers stop, then print their exit codes Options: --help Print usage diff --git a/engine/reference/glossary.md b/engine/reference/glossary.md index 4686ea0dd92..d386d52bbbf 100644 --- a/engine/reference/glossary.md +++ b/engine/reference/glossary.md @@ -1,15 +1,13 @@ ---- -aliases: - - /reference/glossary/ -description: Glossary of terms used around Docker -keywords: -- glossary, docker, terms, definitions -menu: - main: - parent: mn_about - weight: "50" -title: Docker Glossary ---- + # Glossary @@ -17,7 +15,7 @@ A list of terms used around the Docker project. ## aufs -aufs (advanced multi layered unification filesystem) is a Linux [filesystem](glossary.md#filesystem) that +aufs (advanced multi layered unification filesystem) is a Linux [filesystem](#filesystem) that Docker supports as a storage backend. It implements the [union mount](http://en.wikipedia.org/wiki/Union_mount) for Linux file systems. @@ -28,17 +26,17 @@ An image that has no parent is a **base image**. ## boot2docker [boot2docker](http://boot2docker.io/) is a lightweight Linux distribution made -specifically to run Docker containers. The boot2docker management tool for Mac and Windows was deprecated and replaced by [`docker-machine`](glossary.md#machine) which you can install with the Docker Toolbox. +specifically to run Docker containers. The boot2docker management tool for Mac and Windows was deprecated and replaced by [`docker-machine`](#machine) which you can install with the Docker Toolbox. ## btrfs -btrfs (B-tree file system) is a Linux [filesystem](glossary.md#filesystem) that Docker +btrfs (B-tree file system) is a Linux [filesystem](#filesystem) that Docker supports as a storage backend. It is a [copy-on-write](http://en.wikipedia.org/wiki/Copy-on-write) filesystem. ## build -build is the process of building Docker images using a [Dockerfile](glossary.md#dockerfile). +build is the process of building Docker images using a [Dockerfile](#dockerfile). The build uses a Dockerfile and a "context". The context is the set of files in the directory in which the image is built. @@ -62,7 +60,7 @@ be done to get it running. ## container -A container is a runtime instance of a [docker image](glossary.md#image). +A container is a runtime instance of a [docker image](#image). A Docker container consists of @@ -121,7 +119,7 @@ Examples : ## image -Docker images are the basis of [containers](glossary.md#container). An Image is an +Docker images are the basis of [containers](#container). An Image is an ordered collection of root filesystem changes and the corresponding execution parameters for use within a container runtime. An image typically contains a union of layered filesystems stacked on top of each other. An image @@ -172,23 +170,23 @@ for docker containers in a cluster. ## overlay storage driver -OverlayFS is a [filesystem](glossary.md#filesystem) service for Linux which implements a +OverlayFS is a [filesystem](#filesystem) service for Linux which implements a [union mount](http://en.wikipedia.org/wiki/Union_mount) for other file systems. It is supported by the Docker daemon as a storage driver. ## registry -A Registry is a hosted service containing [repositories](glossary.md#repository) of [images](glossary.md#image) +A Registry is a hosted service containing [repositories](#repository) of [images](#image) which responds to the Registry API. -The default registry can be accessed using a browser at [Docker Hub](glossary.md#docker-hub) +The default registry can be accessed using a browser at [Docker Hub](#docker-hub) or using the `docker search` command. ## repository A repository is a set of Docker images. A repository can be shared by pushing it -to a [registry](glossary.md#registry) server. The different images in the repository can be -labeled using [tags](glossary.md#tag). +to a [registry](#registry) server. The different images in the repository can be +labeled using [tags](#tag). Here is an example of the shared [nginx repository](https://hub.docker.com/_/nginx/) and its [tags](https://hub.docker.com/r/library/nginx/tags/) @@ -222,11 +220,11 @@ automatically distributes requests to the service VIP among the active tasks. ## swarm -A [swarm](../swarm/index.md) is a cluster of one or more Docker Engines running in [swarm mode](glossary.md#swarm-mode). +A [swarm](../swarm/index.md) is a cluster of one or more Docker Engines running in [swarm mode](#swarm-mode). ## Swarm -Do not confuse [Docker Swarm](https://github.com/docker/swarm) with the [swarm mode](glossary.md#swarm-mode) features in Docker Engine. +Do not confuse [Docker Swarm](https://github.com/docker/swarm) with the [swarm mode](#swarm-mode) features in Docker Engine. Docker Swarm is the name of a standalone native clustering tool for Docker. Docker Swarm pools together several Docker hosts and exposes them as a single @@ -243,7 +241,7 @@ join nodes to a swarm, the Docker Engine runs in swarm mode. ## tag -A tag is a label applied to a Docker image in a [repository](glossary.md#repository). +A tag is a label applied to a Docker image in a [repository](#repository). tags are how various images in a repository are distinguished from each other. *Note : This label is not related to the key=value labels set for docker daemon* diff --git a/engine/reference/index.md b/engine/reference/index.md index 0f33e54114f..a207ee7d050 100644 --- a/engine/reference/index.md +++ b/engine/reference/index.md @@ -1,16 +1,14 @@ ---- -aliases: - - /reference/ -description: Docker Engine reference -keywords: -- Engine -menu: - main: - identifier: engine_ref - parent: engine_use - weight: 70 -title: Engine reference ---- + # Engine reference diff --git a/engine/reference/run.md b/engine/reference/run.md index 6cf29dfc7ef..375c0c15380 100644 --- a/engine/reference/run.md +++ b/engine/reference/run.md @@ -1,15 +1,13 @@ ---- -aliases: - - /reference/run/ -description: Configure containers at runtime -keywords: -- docker, run, configure, runtime -menu: - main: - parent: engine_ref - weight: -80 -title: Docker run reference ---- + # Docker run reference @@ -60,18 +58,18 @@ types*](commandline/cli.md#option-types). Only the operator (the person executing `docker run`) can set the following options. - - [Detached vs foreground](run.md#detached-vs-foreground) - - [Detached (-d)](run.md#detached-d) - - [Foreground](run.md#foreground) - - [Container identification](run.md#container-identification) - - [Name (--name)](run.md#name-name) - - [PID equivalent](run.md#pid-equivalent) - - [IPC settings (--ipc)](run.md#ipc-settings-ipc) - - [Network settings](run.md#network-settings) - - [Restart policies (--restart)](run.md#restart-policies-restart) - - [Clean up (--rm)](run.md#clean-up-rm) - - [Runtime constraints on resources](run.md#runtime-constraints-on-resources) - - [Runtime privilege and Linux capabilities](run.md#runtime-privilege-and-linux-capabilities) + - [Detached vs foreground](#detached-vs-foreground) + - [Detached (-d)](#detached-d) + - [Foreground](#foreground) + - [Container identification](#container-identification) + - [Name (--name)](#name-name) + - [PID equivalent](#pid-equivalent) + - [IPC settings (--ipc)](#ipc-settings-ipc) + - [Network settings](#network-settings) + - [Restart policies (--restart)](#restart-policies-restart) + - [Clean up (--rm)](#clean-up-rm) + - [Runtime constraints on resources](#runtime-constraints-on-resources) + - [Runtime privilege and Linux capabilities](#runtime-privilege-and-linux-capabilities) ## Detached vs foreground @@ -183,7 +181,7 @@ Images using the v2 or later image 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 and referenceable. -The following example runs a container from the `alpine` image with the +The following example runs a container from the `alpine` image with the `sha256:9cacb71397b640eca97488cf08582ae4e4068513101088e9f96c9814bfda95e0` digest: $ docker run alpine@sha256:9cacb71397b640eca97488cf08582ae4e4068513101088e9f96c9814bfda95e0 date @@ -422,7 +420,7 @@ running the `redis-cli` command and connecting to the Redis server over the You can create a network using a Docker network driver or an external network driver plugin. You can connect multiple containers to the same network. Once connected to a user-defined network, the containers can communicate easily using -only another container's IP address or name. +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 @@ -539,22 +537,18 @@ will try forever to restart the container. The number of (attempted) restarts for a container can be obtained via [`docker inspect`](commandline/inspect.md). For example, to get the number of restarts for container "my-container"; - {% raw %} $ docker inspect -f "{{ .RestartCount }}" my-container # 2 - {% endraw %} Or, to get the last time the container was (re)started; - {% raw %} $ docker inspect -f "{{ .State.StartedAt }}" my-container # 2015-03-04T23:47:07.691840179Z - {% endraw %} Combining `--restart` (restart policy) with the `--rm` (clean up) flag results in an error. On container restart, attached clients are disconnected. See the -examples on using the [`--rm` (clean up)](run.md#clean-up-rm) flag later in this page. +examples on using the [`--rm` (clean up)](#clean-up-rm) flag later in this page. ### Examples @@ -1259,15 +1253,15 @@ Four of the Dockerfile commands cannot be overridden at runtime: `FROM`, in `docker run`. We'll go through what the developer might have set in each Dockerfile instruction and how the operator can override that setting. - - [CMD (Default Command or Options)](run.md#cmd-default-command-or-options) + - [CMD (Default Command or Options)](#cmd-default-command-or-options) - [ENTRYPOINT (Default Command to Execute at Runtime)]( #entrypoint-default-command-to-execute-at-runtime) - - [EXPOSE (Incoming Ports)](run.md#expose-incoming-ports) - - [ENV (Environment Variables)](run.md#env-environment-variables) - - [HEALTHCHECK](run.md#healthcheck) - - [VOLUME (Shared Filesystems)](run.md#volume-shared-filesystems) - - [USER](run.md#user) - - [WORKDIR](run.md#workdir) + - [EXPOSE (Incoming Ports)](#expose-incoming-ports) + - [ENV (Environment Variables)](#env-environment-variables) + - [HEALTHCHECK](#healthcheck) + - [VOLUME (Shared Filesystems)](#volume-shared-filesystems) + - [USER](#user) + - [WORKDIR](#workdir) ### CMD (default command or options) @@ -1308,6 +1302,10 @@ or two examples of how to pass more parameters to that ENTRYPOINT: $ docker run -it --entrypoint /bin/bash example/redis -c ls -l $ docker run -it --entrypoint /usr/bin/redis-cli example/redis --help +You can reset a containers entrypoint by passing an empty string, for example: + + $ docker run -it --entrypoint="" mysql bash + > **Note**: Passing `--entrypoint` will clear out any default command set on the > image (i.e. any `CMD` instruction in the Dockerfile used to build it). @@ -1372,12 +1370,34 @@ it will provide a named alias for the container being linked to. When a new container is created, Docker will set the following environment variables automatically: -| Variable | Value | -| -------- | ----- | -| `HOME` | Set based on the value of `USER` | -| `HOSTNAME` | The hostname associated with the container | -| `PATH` | Includes popular directories, such as `:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin` | -| `TERM` | `xterm` if the container is allocated a pseudo-TTY | + + + + + + + + + + + + + + + + + + + + +
VariableValue
HOME + Set based on the value of USER +
HOSTNAME + The hostname associated with the container +
PATH + Includes popular directories, such as :
+ /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +
TERMxterm if the container is allocated a pseudo-TTY
Additionally, the operator can **set any environment variable** in the container by using one or more `-e` flags, even overriding those mentioned @@ -1406,7 +1426,6 @@ Similarly the operator can set the **hostname** with `-h`. Example: - {% raw %} $ docker run --name=test -d \ --health-cmd='stat /etc/passwd || exit 1' \ --health-interval=2s \ @@ -1451,7 +1470,6 @@ Example: } ] } - {% endraw %} The health status is also displayed in the `docker ps` output. diff --git a/engine/security/apparmor.md b/engine/security/apparmor.md index bcafcfaed48..0ef58616399 100644 --- a/engine/security/apparmor.md +++ b/engine/security/apparmor.md @@ -1,13 +1,13 @@ ---- -description: Enabling AppArmor in Docker -keywords: -- AppArmor, security, docker, documentation -menu: - main: - parent: smn_secure_docker - weight: 5 -title: AppArmor security profiles for Docker ---- + # AppArmor security profiles for Docker @@ -59,7 +59,7 @@ profile docker-default flags=(attach_disconnected,mediate_deleted) { deny /sys/fs/[^c]*/** wklx, deny /sys/fs/c[^g]*/** wklx, deny /sys/fs/cg[^r]*/** wklx, - deny /sys/firmware/efi/efivars/** rwklx, + deny /sys/firmware/** rwklx, deny /sys/kernel/security/** rwklx, } ``` @@ -175,7 +175,7 @@ profile docker-nginx flags=(attach_disconnected,mediate_deleted) { deny /sys/fs/[^c]*/** wklx, deny /sys/fs/c[^g]*/** wklx, deny /sys/fs/cg[^r]*/** wklx, - deny /sys/firmware/efi/efivars/** rwklx, + deny /sys/firmware/** rwklx, deny /sys/kernel/security/** rwklx, } ``` diff --git a/engine/security/certificates.md b/engine/security/certificates.md index 95c075a1355..5684e331e30 100644 --- a/engine/security/certificates.md +++ b/engine/security/certificates.md @@ -1,15 +1,13 @@ ---- -aliases: -- /engine/articles/certificates/ -description: How to set up and use certificates with a registry to verify access -keywords: -- Usage, registry, repository, client, root, certificate, docker, apache, ssl, tls, - documentation, examples, articles, tutorials -menu: - main: - parent: smn_secure_docker -title: Using certificates for repository client verification ---- + # Using certificates for repository client verification @@ -60,7 +58,7 @@ creating an os-provided bundled certificate chain. ## Creating the client certificates You will use OpenSSL's `genrsa` and `req` commands to first generate an RSA -key and then use the key to create the certificate. +key and then use the key to create the certificate. $ openssl genrsa -out client.key 4096 $ openssl req -new -x509 -text -key client.key -out client.cert @@ -72,7 +70,7 @@ key and then use the key to create the certificate. ## Troubleshooting tips -The Docker daemon interprets `.crt` files as CA certificates and `.cert` files +The Docker daemon interprets ``.crt` files as CA certificates and `.cert` files as client certificates. If a CA certificate is accidentally given the extension `.cert` instead of the correct `.crt` extension, the Docker daemon logs the following error message: diff --git a/engine/security/https.md b/engine/security/https.md index 548a8a9a462..b106471de96 100644 --- a/engine/security/https.md +++ b/engine/security/https.md @@ -1,15 +1,13 @@ ---- -aliases: -- /engine/articles/https/ -- /articles/https/ -description: How to setup and run Docker with HTTPS -keywords: -- docker, docs, article, example, https, daemon, tls, ca, certificate -menu: - main: - parent: smn_secure_docker -title: Protect the Docker daemon socket ---- + # Protect the Docker daemon socket diff --git a/engine/security/https/Dockerfile b/engine/security/https/Dockerfile index 0e7f88d4200..a3cc132c513 100644 --- a/engine/security/https/Dockerfile +++ b/engine/security/https/Dockerfile @@ -1,7 +1,3 @@ ---- -{} ---- - FROM debian RUN apt-get update && apt-get install -yq openssl diff --git a/engine/security/https/Makefile b/engine/security/https/Makefile index 8a58b66880b..a346a43e222 100644 --- a/engine/security/https/Makefile +++ b/engine/security/https/Makefile @@ -1,6 +1,3 @@ ---- -{} ---- HOST:=boot2docker diff --git a/engine/security/https/README.md b/engine/security/https/README.md index 260aee536c3..9bd340a5c88 100644 --- a/engine/security/https/README.md +++ b/engine/security/https/README.md @@ -1,6 +1,10 @@ ---- -draft: true ---- + + + This is an initial attempt to make it easier to test the examples in the https.md doc. diff --git a/engine/security/https/make_certs.sh b/engine/security/https/make_certs.sh old mode 100644 new mode 100755 index 1d7982bb94a..39001fdb506 --- a/engine/security/https/make_certs.sh +++ b/engine/security/https/make_certs.sh @@ -1,5 +1,3 @@ - - #!/bin/sh openssl genrsa -aes256 -out ca-key.pem 2048 openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem diff --git a/engine/security/https/parsedocs.sh b/engine/security/https/parsedocs.sh old mode 100644 new mode 100755 index ef3eef35b8c..f9df33c3374 --- a/engine/security/https/parsedocs.sh +++ b/engine/security/https/parsedocs.sh @@ -1,5 +1,3 @@ - - #!/bin/sh echo "#!/bin/sh" diff --git a/engine/security/index.md b/engine/security/index.md index 312b409b427..9524a93ef99 100644 --- a/engine/security/index.md +++ b/engine/security/index.md @@ -1,13 +1,13 @@ ---- -description: Sec -keywords: -- seccomp, security, docker, documentation -menu: - main: - identifier: smn_secure_docker - parent: engine_use -title: Secure Engine ---- + # Secure Engine diff --git a/engine/security/non-events.md b/engine/security/non-events.md index 3c9c722b1c2..e0689441203 100644 --- a/engine/security/non-events.md +++ b/engine/security/non-events.md @@ -1,12 +1,12 @@ ---- -description: Review of security vulnerabilities Docker mitigated -keywords: -- Docker, Docker documentation, security, security non-events -menu: - main: - parent: smn_secure_docker -title: Docker Security Non-events ---- + # Docker Security Non-events diff --git a/engine/security/seccomp.md b/engine/security/seccomp.md index 9a947955f73..c9b7459c539 100644 --- a/engine/security/seccomp.md +++ b/engine/security/seccomp.md @@ -1,13 +1,13 @@ ---- -description: Enabling seccomp in Docker -keywords: -- seccomp, security, docker, documentation -menu: - main: - parent: smn_secure_docker - weight: 90 -title: Seccomp security profiles for Docker ---- + # Seccomp security profiles for Docker @@ -40,24 +40,65 @@ compatibility. The default Docker profile (found [here](https://github.com/docke ```json { "defaultAction": "SCMP_ACT_ERRNO", - "architectures": [ - "SCMP_ARCH_X86_64", - "SCMP_ARCH_X86", - "SCMP_ARCH_X32" + "archMap": [ + { + "architecture": "SCMP_ARCH_X86_64", + "subArchitectures": [ + "SCMP_ARCH_X86", + "SCMP_ARCH_X32" + ] + }, + ... ], "syscalls": [ { - "name": "accept", + "names": [ + "accept", + "accept4", + "access", + "alarm", + "alarm", + "bind", + "brk", + ... + "waitid", + "waitpid", + "write", + "writev" + ], "action": "SCMP_ACT_ALLOW", - "args": [] + "args": [], + "comment": "", + "includes": {}, + "excludes": {} }, { - "name": "accept4", + "names": [ + "clone" + ], "action": "SCMP_ACT_ALLOW", - "args": [] + "args": [ + { + "index": 1, + "value": 2080505856, + "valueTwo": 0, + "op": "SCMP_CMP_MASKED_EQ" + } + ], + "comment": "s390 parameter ordering for clone is different", + "includes": { + "arches": [ + "s390", + "s390x" + ] + }, + "excludes": { + "caps": [ + "CAP_SYS_ADMIN" + ] + } }, ... - ] } ``` diff --git a/engine/security/security.md b/engine/security/security.md index 0ba05454300..7a17f869f89 100644 --- a/engine/security/security.md +++ b/engine/security/security.md @@ -1,15 +1,14 @@ ---- -aliases: -- /engine/articles/security/ -description: Review of the Docker Daemon attack surface -keywords: -- Docker, Docker documentation, security -menu: - main: - parent: smn_secure_docker - weight: -99 -title: Docker security ---- + # Docker security diff --git a/engine/security/trust/content_trust.md b/engine/security/trust/content_trust.md index 776f56812ef..4334b10f050 100644 --- a/engine/security/trust/content_trust.md +++ b/engine/security/trust/content_trust.md @@ -1,13 +1,13 @@ ---- -description: Enabling content trust in Docker -keywords: -- content, trust, security, docker, documentation -menu: - main: - parent: smn_content_trust - weight: -1 -title: Content trust in Docker ---- + # Content trust in Docker diff --git a/engine/security/trust/deploying_notary.md b/engine/security/trust/deploying_notary.md index e96457199cf..9da685f42ec 100644 --- a/engine/security/trust/deploying_notary.md +++ b/engine/security/trust/deploying_notary.md @@ -1,12 +1,12 @@ ---- -description: Deploying Notary -keywords: -- trust, security, notary, deployment -menu: - main: - parent: smn_content_trust -title: Deploying Notary ---- + # Deploying Notary Server with Compose diff --git a/engine/security/trust/index.md b/engine/security/trust/index.md index 11f7dab6613..8f596932368 100644 --- a/engine/security/trust/index.md +++ b/engine/security/trust/index.md @@ -1,14 +1,14 @@ ---- -description: Use trusted images -keywords: -- trust, security, docker, index -menu: - main: - identifier: smn_content_trust - parent: smn_secure_docker - weight: 4 -title: Use trusted images ---- + # Use trusted images diff --git a/engine/security/trust/trust_automation.md b/engine/security/trust/trust_automation.md index f2beb57ec8a..73156ab9758 100644 --- a/engine/security/trust/trust_automation.md +++ b/engine/security/trust/trust_automation.md @@ -1,12 +1,12 @@ ---- -description: Automating content push pulls with trust -keywords: -- trust, security, docker, documentation, automation -menu: - main: - parent: smn_content_trust -title: Automation with content trust ---- + # Automation with content trust diff --git a/engine/security/trust/trust_delegation.md b/engine/security/trust/trust_delegation.md index 71d5f184696..b633db0aa40 100644 --- a/engine/security/trust/trust_delegation.md +++ b/engine/security/trust/trust_delegation.md @@ -1,12 +1,12 @@ ---- -description: Delegations for content trust -keywords: -- trust, security, delegations, keys, repository -menu: - main: - parent: smn_content_trust -title: Delegations for content trust ---- + # Delegations for content trust @@ -102,7 +102,7 @@ to rotate the snapshot key specifically, and you want the server to manage it (` stands for "remote"). When adding a delegation, your must acquire -[the PEM-encoded x509 certificate with the public key](trust_delegation.md#generating-delegation-keys) +[the PEM-encoded x509 certificate with the public key](#generating-delegation-keys) of the collaborator you wish to delegate to. Assuming you have the certificate `delegation.crt`, you can add a delegation diff --git a/engine/security/trust/trust_key_mng.md b/engine/security/trust/trust_key_mng.md index 86c56cbe429..cbb51c8d436 100644 --- a/engine/security/trust/trust_key_mng.md +++ b/engine/security/trust/trust_key_mng.md @@ -1,12 +1,12 @@ ---- -description: Manage keys for content trust -keywords: -- trust, security, root, keys, repository -menu: - main: - parent: smn_content_trust -title: Manage keys for content trust ---- + # Manage keys for content trust diff --git a/engine/security/trust/trust_sandbox.md b/engine/security/trust/trust_sandbox.md index 11c9b9e3b3b..6d288fb9c33 100644 --- a/engine/security/trust/trust_sandbox.md +++ b/engine/security/trust/trust_sandbox.md @@ -1,12 +1,12 @@ ---- -description: Play in a trust sandbox -keywords: -- trust, security, root, keys, repository, sandbox -menu: - main: - parent: smn_content_trust -title: Play in a content trust sandbox ---- + # Play in a content trust sandbox @@ -83,7 +83,7 @@ the `trustsandbox` container, the Notary server, and the Registry server. version: "2" services: notaryserver: - image: dockersecurity/notary_autobuilds:server-latest + image: dockersecurity/notary_autobuilds:server volumes: - notarycerts:/go/src/github.com/docker/notary/fixtures networks: diff --git a/engine/static_files/README.md b/engine/static_files/README.md index 36a478ea24f..0b93167bdea 100644 --- a/engine/static_files/README.md +++ b/engine/static_files/README.md @@ -1,6 +1,8 @@ ---- -draft: true ---- + Static files dir ================ diff --git a/engine/swarm/admin_guide.md b/engine/swarm/admin_guide.md index 15ce1faf155..7df810a1196 100644 --- a/engine/swarm/admin_guide.md +++ b/engine/swarm/admin_guide.md @@ -1,16 +1,17 @@ ---- -aliases: -- /engine/swarm/manager-administration-guide/ -description: Manager administration guide -keywords: -- docker, container, swarm, manager, raft -menu: - main: - identifier: manager_admin_guide - parent: engine_swarm - weight: "20" -title: Swarm administration guide ---- + # Administer and maintain a swarm of Docker Engines @@ -21,15 +22,15 @@ maintain the swarm. This article covers the following swarm administration tasks: -* [Using a static IP for manager node advertise address](admin_guide.md#use-a-static-ip-for-manager-node-advertise-address) -* [Adding manager nodes for fault tolerance](admin_guide.md#add-manager-nodes-for-fault-tolerance) -* [Distributing manager nodes](admin_guide.md#distribute-manager-nodes) -* [Running manager-only nodes](admin_guide.md#run-manager-only-nodes) -* [Backing up the swarm state](admin_guide.md#back-up-the-swarm-state) -* [Monitoring the swarm health](admin_guide.md#monitor-swarm-health) -* [Troubleshooting a manager node](admin_guide.md#troubleshoot-a-manager-node) -* [Forcefully removing a node](admin_guide.md#force-remove-a-node) -* [Recovering from disaster](admin_guide.md#recover-from-disaster) +* [Using a static IP for manager node advertise address](#use-a-static-ip-for-manager-node-advertise-address) +* [Adding manager nodes for fault tolerance](#add-manager-nodes-for-fault-tolerance) +* [Distributing manager nodes](#distribute-manager-nodes) +* [Running manager-only nodes](#run-manager-only-nodes) +* [Backing up the swarm state](#back-up-the-swarm-state) +* [Monitoring the swarm health](#monitor-swarm-health) +* [Troubleshooting a manager node](#troubleshoot-a-manager-node) +* [Forcefully removing a node](#force-remove-a-node) +* [Recovering from disaster](#recover-from-disaster) Refer to [How nodes work](how-swarm-mode-works/nodes.md) for a brief overview of Docker Swarm mode and the difference between manager and @@ -91,13 +92,13 @@ guaranteed if you encounter more than two network partitions. For example, in a swarm with *5 nodes*, if you lose *3 nodes*, you don't have a quorum. Therefore you can't add or remove nodes until you recover one of the unavailable manager nodes or recover the swarm with disaster recovery -commands. See [Recover from disaster](admin_guide.md#recover-from-disaster). +commands. See [Recover from disaster](#recover-from-disaster). While it is possible to scale a swarm down to a single manager node, it is impossible to demote the last manager node. This ensures you maintain access to the swarm and that the swarm can still process requests. Scaling down to a single manager is an unsafe operation and is not recommended. If -the last node leaves the swarm unexpectedly during the demote operation, the +the last node leaves the swarm unexpetedly during the demote operation, the swarm will become unavailable until you reboot the node or restart with `--force-new-cluster`. @@ -154,7 +155,7 @@ directory: ``` Back up the `raft` data directory often so that you can use it in case of -[disaster recovery](admin_guide.md#recover-from-disaster). Then you can take the `raft` +[disaster recovery](#recover-from-disaster). Then you can take the `raft` directory of one of the manager nodes to restore to a new swarm. ## Monitor swarm health @@ -166,17 +167,17 @@ for more information. From the command line, run `docker node inspect ` to query the nodes. For instance, to query the reachability of the node as a manager: -```bash{% raw %} +```bash docker node inspect manager1 --format "{{ .ManagerStatus.Reachability }}" reachable -{% endraw %}``` +``` To query the status of the node as a worker that accept tasks: -```bash{% raw %} +```bash docker node inspect manager1 --format "{{ .Status.State }}" ready -{% endraw %}``` +``` From those commands, we can see that `manager1` is both at the status `reachable` as a manager and `ready` as a worker. diff --git a/engine/swarm/how-swarm-mode-works/menu.md b/engine/swarm/how-swarm-mode-works/menu.md index 0fb4b3bb4fe..c83b74b53aa 100644 --- a/engine/swarm/how-swarm-mode-works/menu.md +++ b/engine/swarm/how-swarm-mode-works/menu.md @@ -1,14 +1,14 @@ ---- -description: How the components of swarm mode work -keywords: -- cluster, swarm -menu: - main: - identifier: how-swarm-works - parent: engine_swarm - weight: 11 -title: How swarm mode works ---- + # How swarm mode works guide @@ -16,3 +16,4 @@ title: How swarm mode works * [How nodes work](nodes.md) * [How services work](services.md) +* [How PKI works](pki.md) diff --git a/engine/swarm/how-swarm-mode-works/nodes.md b/engine/swarm/how-swarm-mode-works/nodes.md index a4bb5386add..ac8dc76b3fb 100644 --- a/engine/swarm/how-swarm-mode-works/nodes.md +++ b/engine/swarm/how-swarm-mode-works/nodes.md @@ -1,16 +1,17 @@ ---- -aliases: -- /engine/swarm/how-swarm-mode-works/ -description: How swarm nodes work -keywords: -- docker, container, cluster, swarm mode, node -menu: - main: - identifier: how-nodes-work - parent: how-swarm-works - weight: "3" -title: How nodes work ---- + # How nodes work @@ -19,8 +20,8 @@ cluster of one or more Docker Engines called a swarm. A swarm consists of one or more nodes: physical or virtual machines running Docker Engine 1.12 or later in swarm mode. -There are two types of nodes: [**managers**](nodes.md#manager-nodes) and -[**workers**](nodes.md#worker-nodes). +There are two types of nodes: [**managers**](#manager-nodes) and +[**workers**](#worker-nodes). ![Swarm mode cluster](../images/swarm-diagram.png) diff --git a/engine/swarm/how-swarm-mode-works/pki.md b/engine/swarm/how-swarm-mode-works/pki.md index 96f08292a4b..3ddb874d7d8 100644 --- a/engine/swarm/how-swarm-mode-works/pki.md +++ b/engine/swarm/how-swarm-mode-works/pki.md @@ -1,20 +1,14 @@ ---- -description: How PKI works in swarm mode -keywords: -- docker -- container -- cluster -- swarm mode -- node -- tls -- pki -menu: - main: - identifier: how-pki-work - parent: how-swarm-works - weight: "5" -title: How PKI works ---- + # How PKI works in swarm mode diff --git a/engine/swarm/how-swarm-mode-works/services.md b/engine/swarm/how-swarm-mode-works/services.md index 34c712e3f4d..17c561c3b22 100644 --- a/engine/swarm/how-swarm-mode-works/services.md +++ b/engine/swarm/how-swarm-mode-works/services.md @@ -1,14 +1,14 @@ ---- -description: How swarm mode services work -keywords: -- docker, container, cluster, swarm mode, node -menu: - main: - identifier: how-services-work - parent: how-swarm-works - weight: "4" -title: How services work ---- + # How services work @@ -61,14 +61,14 @@ that spawns a new container. A task is a one-directional mechanism. It progresses monotonically through a series of states: assigned, prepared, running, etc. If the task fails the -scheduler removes the task and its container and then creates a new task to +orchestrator removes the task and its container and then creates a new task to replace it according to the desired state specified by the service. The underlying logic of Docker swarm mode is a general purpose scheduler and orchestrator. The service and task abstractions themselves are unaware of the containers they implement. Hypothetically, you could implement other types of tasks such as virtual machine tasks or non-containerized process tasks. The -scheduler and orchestrator are agnostic about they type of task. However, the +scheduler and orchestrator are agnostic about their type of task. However, the current version of Docker only supports container tasks. The diagram below shows how swarm mode accepts service create requests and @@ -98,5 +98,5 @@ in gray. ## Learn More -* Read about how swarm mode [nodes](nodes.md) work. +* Read about how swarm mode [nodes](services.md) work. * Learn how [PKI](pki.md) works in swarm mode. diff --git a/engine/swarm/index.md b/engine/swarm/index.md index b010a04ff55..55d78b6ea92 100644 --- a/engine/swarm/index.md +++ b/engine/swarm/index.md @@ -1,15 +1,14 @@ ---- -description: Docker Engine swarm mode overview -keywords: -- docker, container, cluster, swarm -menu: - main: - identifier: swarm_overview - parent: engine_swarm - weight: "1" -title: Swarm mode overview ---- - + # Swarm mode overview To use Docker Engine in swarm mode, install the Docker Engine `v1.12.0` or diff --git a/engine/swarm/ingress.md b/engine/swarm/ingress.md index a1e99ff6ac0..73910e719cf 100644 --- a/engine/swarm/ingress.md +++ b/engine/swarm/ingress.md @@ -1,19 +1,14 @@ ---- -description: Use the routing mesh to publish services externally to a swarm -keywords: -- guide -- swarm mode -- swarm -- network -- ingress -- routing mesh -menu: - main: - identifier: ingress-guide - parent: engine_swarm - weight: 17 -title: Use swarm mode routing mesh ---- + # Use swarm mode routing mesh @@ -79,11 +74,11 @@ $ docker service update \ You can use `docker service inspect` to view the service's published port. For instance: -```bash{% raw %} +```bash $ docker service inspect --format="{{json .Endpoint.Spec.Ports}}" my-web [{"Protocol":"tcp","TargetPort":80,"PublishedPort":8080}] -{% endraw %}``` +``` The output shows the `` from the containers and the `` where nodes listen for requests for the service. diff --git a/engine/swarm/join-nodes.md b/engine/swarm/join-nodes.md index 6c3d45b4498..3a8cde98ebc 100644 --- a/engine/swarm/join-nodes.md +++ b/engine/swarm/join-nodes.md @@ -1,14 +1,14 @@ ---- -description: Add worker and manager nodes to a swarm -keywords: -- guide, swarm mode, node -menu: - main: - identifier: join-nodes-guide - parent: engine_swarm - weight: 13 -title: Join nodes to a swarm ---- + # Join nodes to a swarm @@ -18,7 +18,7 @@ swarm mode. To take full advantage of swarm mode you can add nodes to the swarm: * Adding worker nodes increases capacity. When you deploy a service to a swarm, the Engine schedules tasks on available nodes whether they are worker nodes or manager nodes. When you add workers to your swarm, you increase the scale of -the swarm to handle tasks without affecting the manager raft consensus. +the swarm to handle tasks without affecting the manager raft consenus. * Manager nodes increase fault-tolerance. Manager nodes perform the orchestration and cluster management functions for the swarm. Among manager nodes, a single leader node conducts orchestration tasks. If a leader node diff --git a/engine/swarm/key-concepts.md b/engine/swarm/key-concepts.md index 302e4527755..e0e88e22b9e 100644 --- a/engine/swarm/key-concepts.md +++ b/engine/swarm/key-concepts.md @@ -1,15 +1,14 @@ ---- -description: Introducing key concepts for Docker Engine swarm mode -keywords: -- docker, container, cluster, swarm mode -menu: - main: - identifier: swarm-mode-concepts - parent: engine_swarm - weight: "2" -title: Swarm mode key concepts ---- - + # Swarm mode key concepts This topic introduces some of the concepts unique to the cluster management and @@ -23,7 +22,7 @@ running in **swarm mode**. You enable swarm mode for the Engine by either initializing a swarm or joining an existing swarm. A **swarm** is a cluster of Docker Engines where you deploy -[services](key-concepts.md#Services-and-tasks). The Docker Engine CLI includes the commands for +[services](#Services-and-tasks). The Docker Engine CLI includes the commands for swarm management, such as adding and removing nodes. The CLI also includes the commands you need to deploy services to the swarm and manage service orchestration. @@ -37,7 +36,7 @@ A **node** is an instance of the Docker Engine participating in the swarm. To deploy your application to a swarm, you submit a service definition to a **manager node**. The manager node dispatches units of work called -[tasks](key-concepts.md#Services-and-tasks) to worker nodes. +[tasks](#Services-and-tasks) to worker nodes. Manager nodes also perform the orchestration and cluster management functions required to maintain the desired state of the swarm. Manager nodes elect a single leader to conduct orchestration tasks. diff --git a/engine/swarm/manage-nodes.md b/engine/swarm/manage-nodes.md index a02f8ab6096..431afba7d78 100644 --- a/engine/swarm/manage-nodes.md +++ b/engine/swarm/manage-nodes.md @@ -1,23 +1,23 @@ ---- -description: Manage existing nodes in a swarm -keywords: -- guide, swarm mode, node -menu: - main: - identifier: manage-nodes-guide - parent: engine_swarm - weight: 14 -title: Manage nodes in a swarm ---- + # Manage nodes in a swarm As part of the swarm management lifecycle, you may need to view or update a node as follows: -* [list nodes in the swarm](manage-nodes.md#list-nodes) -* [inspect an individual node](manage-nodes.md#inspect-an-individual-node) -* [update a node](manage-nodes.md#update-a-node) -* [leave the swarm](manage-nodes.md#leave-the-swarm) +* [list nodes in the swarm](#list-nodes) +* [inspect an individual node](#inspect-an-individual-node) +* [update a node](#update-a-node) +* [leave the swarm](#leave-the-swarm) ## List nodes @@ -95,9 +95,9 @@ Engine Version: 1.12.0-dev You can modify node attributes as follows: -* [change node availability](manage-nodes.md#change-node-availability) -* [add or remove label metadata](manage-nodes.md#add-or-remove-label-metadata) -* [change a node role](manage-nodes.md#promote-or-demote-a-node) +* [change node availability](#change-node-availability) +* [add or remove label metadata](#add-or-remove-label-metadata) +* [change a node role](#promote-or-demote-a-node) ### Change node availability @@ -117,7 +117,7 @@ $ docker node update --availability drain node-1 node-1 ``` -See [list nodes](manage-nodes.md#list-nodes) for descriptions of the different availability +See [list nodes](#list-nodes) for descriptions of the different availability options. ### Add or remove label metadata diff --git a/engine/swarm/menu.md b/engine/swarm/menu.md index 71032378bdc..369877a3211 100644 --- a/engine/swarm/menu.md +++ b/engine/swarm/menu.md @@ -1,15 +1,16 @@ ---- -description: How to use Docker Engine swarm mode -keywords: -- ' docker, documentation, developer, ' -menu: - main: - identifier: engine_swarm - parent: engine_use - weight: 0 -title: Manage a swarm -type: menu ---- + + ## Use Docker Engine to create and manage a swarm diff --git a/engine/swarm/networking.md b/engine/swarm/networking.md index 88966ad54f5..695d4df5676 100644 --- a/engine/swarm/networking.md +++ b/engine/swarm/networking.md @@ -1,17 +1,14 @@ ---- -description: Use swarm mode networking features -keywords: -- guide -- swarm mode -- swarm -- network -menu: - main: - identifier: networking-guide - parent: engine_swarm - weight: 16 -title: Attach services to an overlay network ---- + # Attach services to an overlay network @@ -56,7 +53,7 @@ different nodes. For more information, refer to [Docker swarm mode overlay netwo The `--subnet` flag specifies the subnet for use with the overlay network. When you don't specify a subnet, the swarm manager automatically chooses a subnet and assigns it to the network. On some older kernels, including kernel 3.10, -automatically assigned addresses may overlap with another subnet in your +automatically assigned adresses may overlap with another subnet in your infrastructure. Such overlaps can cause connectivity issues or failures with containers connected to the network. Before you attach a service to the network, the network only extends to manager @@ -103,10 +100,10 @@ tasks are running for the service: ```bash $ docker service ps my-web -ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR -63s86gf6a0ms34mvboniev7bs my-web.1 nginx node1 Running Running 58 seconds ago -6b3q2qbjveo4zauc6xig7au10 my-web.2 nginx node2 Running Running 58 seconds ago -66u2hcrz0miqpc8h0y0f3v7aw my-web.3 nginx node3 Running Running about a minute ago +NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR +my-web.1.63s86gf6a0ms34mvboniev7bs nginx node1 Running Running 58 seconds ago +my-web.2.6b3q2qbjveo4zauc6xig7au10 nginx node2 Running Running 58 seconds ago +my-web.3.66u2hcrz0miqpc8h0y0f3v7aw nginx node3 Running Running about a minute ago ``` ![service vip image](images/service-vip.png) @@ -175,13 +172,13 @@ active tasks. You can inspect the service to view the virtual IP. For example: -```bash{% raw %} +```bash $ docker service inspect \ --format='{{json .Endpoint.VirtualIPs}}' \ my-web [{"NetworkID":"7m2rjx0a97n88wzr4nu8772r3" "Addr":"10.0.0.2/24"}] -{% endraw %}``` +``` The following example shows how you can add a `busybox` service on the same network as the `nginx` service and the busybox service is able to access `nginx` @@ -203,8 +200,8 @@ using the DNS name `my-web`: ```bash $ docker service ps my-busybox - ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR - 1dok2cmx2mln5hbqve8ilnair my-busybox.1 busybox node1 Running Running 5 seconds ago + NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR + my-busybox.1.1dok2cmx2mln5hbqve8ilnair busybox node1 Running Running 5 seconds ago ``` 3. From the node where the busybox task is running, open an interactive shell to @@ -299,7 +296,7 @@ Address 3: 10.0.9.9 my-dnsrr-service.2.am6fx47p3bropyy2dy4f8hofb.my-network ## Confirm VIP connectivity -In general we recommend you use `dig`, `nslookup`, or another DNS query tool to +In genaral we recommend you use `dig`, `nslookup`, or another DNS query tool to test access to the service name via DNS. Because a VIP is a logical IP, `ping` is not the right tool to confirm VIP connectivity. diff --git a/engine/swarm/raft.md b/engine/swarm/raft.md index 3f8dd4631f6..396178053b2 100644 --- a/engine/swarm/raft.md +++ b/engine/swarm/raft.md @@ -1,14 +1,14 @@ ---- -description: Raft consensus algorithm in swarm mode -keywords: -- docker, container, cluster, swarm, raft -menu: - main: - identifier: raft - parent: engine_swarm - weight: "21" -title: Raft consensus in swarm mode ---- + ## Raft consensus algorithm diff --git a/engine/swarm/services.md b/engine/swarm/services.md index bf4e4fcba10..d5494b6fe3d 100644 --- a/engine/swarm/services.md +++ b/engine/swarm/services.md @@ -1,17 +1,14 @@ ---- -description: Deploy services to a swarm -keywords: -- guide -- swarm mode -- swarm -- service -menu: - main: - identifier: services-guide - parent: engine_swarm - weight: 15 -title: Deploy services to a swarm ---- + # Deploy services to a swarm @@ -60,7 +57,7 @@ anixjtol6wdf my_web 1/1 nginx ``` To make the web server accessible from outside the swarm, you need to -[publish the port](services.md#publish-ports-externally-to-the-swarm) where the swarm +[publish the port](#publish-ports-externally-to-the-swarm) where the swarm listens for web requests. You can include a command to run inside containers after the image: @@ -138,8 +135,8 @@ Swarm mode lets you network services in a couple of ways: ### Publish ports externally to the swarm -You publish service ports externally to the swarm using the `--publish:` -flag. When you publish a service port, the swarm +You publish service ports externally to the swarm using the `--publish +:` flag. When you publish a service port, the swarm makes the service accessible at the target port on every node regardless if there is a task for the service running on the node. diff --git a/engine/swarm/swarm-mode.md b/engine/swarm/swarm-mode.md index 222705ac581..6f2a09cee51 100644 --- a/engine/swarm/swarm-mode.md +++ b/engine/swarm/swarm-mode.md @@ -1,14 +1,14 @@ ---- -description: Run Docker Engine in swarm mode -keywords: -- guide, swarm mode, node -menu: - main: - identifier: initialize-swarm-guide - parent: engine_swarm - weight: 12 -title: Run Docker Engine in swarm mode ---- + # Run Docker Engine in swarm mode @@ -45,7 +45,7 @@ as follows: * designates the current node as a leader manager node for the swarm. * names the node with the machine hostname. * configures the manager to listen on an active network interface on port 2377. -* sets the current node to `Active` availability, meaning it can receive tasks +* sets the current node to `Active` availability, meanining it can receive tasks from the scheduler. * starts an internal distributed data store for Engines participating in the swarm to maintain a consistent view of the swarm and all services running on it. @@ -92,7 +92,7 @@ reach the first manager node is not the same address the manager sees as its own. For instance, in a cloud setup that spans different regions, hosts have both internal addresses for access within the region and external addresses that you use for access from outside that region. In this case, specify the external -address with `--advertise-addr` so that the node can propagate that information +address with `--advertise-addr` so that the node can propogate that information to other nodes that subsequently connect to it. Refer to the `docker swarm init` [CLI reference](../reference/commandline/swarm_init.md) diff --git a/engine/swarm/swarm-tutorial/add-nodes.md b/engine/swarm/swarm-tutorial/add-nodes.md index e5e9d2ee637..364d3f40a03 100644 --- a/engine/swarm/swarm-tutorial/add-nodes.md +++ b/engine/swarm/swarm-tutorial/add-nodes.md @@ -1,14 +1,14 @@ ---- -description: Add nodes to the swarm -keywords: -- tutorial, cluster management, swarm -menu: - main: - identifier: add-nodes - parent: swarm-tutorial - weight: 13 -title: Add nodes to the swarm ---- + # Add nodes to the swarm @@ -18,7 +18,7 @@ to add worker nodes. 1. Open a terminal and ssh into the machine where you want to run a worker node. This tutorial uses the name `worker1`. -2. Run the command produced by the `docker swarm init` output from the +2. Run the command produced by the `docker swarm init` output from the [Create a swarm](create-swarm.md) tutorial step to create a worker node joined to the existing swarm: ```bash @@ -45,7 +45,7 @@ This tutorial uses the name `worker1`. 3. Open a terminal and ssh into the machine where you want to run a second worker node. This tutorial uses the name `worker2`. -4. Run the command produced by the `docker swarm init` output from the +4. Run the command produced by the `docker swarm init` output from the [Create a swarm](create-swarm.md) tutorial step to create a second worker node joined to the existing swarm: @@ -57,7 +57,7 @@ joined to the existing swarm: This node joined a swarm as a worker. ``` -5. Open a terminal and ssh into the machine where the manager node runs and run +5. Open a terminal and ssh into the machine where the manager node runs and run the `docker node ls` command to see the worker nodes: ```bash diff --git a/engine/swarm/swarm-tutorial/create-swarm.md b/engine/swarm/swarm-tutorial/create-swarm.md index 4b9ed59092a..642b96ec1c4 100644 --- a/engine/swarm/swarm-tutorial/create-swarm.md +++ b/engine/swarm/swarm-tutorial/create-swarm.md @@ -1,14 +1,14 @@ ---- -description: Initialize the swarm -keywords: -- tutorial, cluster management, swarm mode -menu: - main: - identifier: initialize-swarm - parent: swarm-tutorial - weight: 12 -title: Create a swarm ---- + # Create a swarm @@ -19,17 +19,17 @@ machines. 1. Open a terminal and ssh into the machine where you want to run your manager node. For example, the tutorial uses a machine named `manager1`. -2. Run the following command to create a new swarm: +2. Run the following command to create a new swarm: ```bash docker swarm init --advertise-addr ``` >**Note:** If you are using Docker for Mac or Docker for Windows to test - single-node swarm, simply run `docker swarm init` with no arguments. There is no - need to specify `--advertise-addr` in this case. To learn more, see the topic - on how to [Use Docker for Mac or Docker for - Windows](index.md#use-docker-for-mac-or-docker-for-windows) with Swarm. +single-node swarm, simply run `docker swarm init` with no arguments. There is no +need to specify ` --advertise-addr` in this case. To learn more, see the topic +on how to [Use Docker for Mac or Docker for +Windows](index.md#use-docker-for-mac-or-docker-for-windows) with Swarm. In the tutorial, the following command creates a swarm on the `manager1` machine: @@ -55,7 +55,7 @@ node. For example, the tutorial uses a machine named `manager1`. join as managers or workers depending on the value for the `--token` flag. -2. Run `docker info` to view the current state of the swarm: +2. Run `docker info` to view the current state of the swarm: ```bash $ docker info @@ -73,7 +73,7 @@ node. For example, the tutorial uses a machine named `manager1`. ...snip... ``` -3. Run the `docker node ls` command to view information about nodes: +3. Run the `docker node ls` command to view information about nodes: ```bash $ docker node ls diff --git a/engine/swarm/swarm-tutorial/delete-service.md b/engine/swarm/swarm-tutorial/delete-service.md index b9cc6216a14..ba9b19848b3 100644 --- a/engine/swarm/swarm-tutorial/delete-service.md +++ b/engine/swarm/swarm-tutorial/delete-service.md @@ -1,14 +1,14 @@ ---- -description: Remove the service from the swarm -keywords: -- tutorial, cluster management, swarm, service -menu: - main: - identifier: swarm-tutorial-delete-service - parent: swarm-tutorial - weight: 19 -title: Delete the service ---- + # Delete the service running on the swarm @@ -19,7 +19,7 @@ you can delete the service from the swarm. run your manager node. For example, the tutorial uses a machine named `manager1`. -2. Run `docker service rm helloworld` to remove the `helloworld` service. +2. Run `docker service rm helloworld` to remove the `helloworld` service. ``` $ docker service rm helloworld @@ -27,7 +27,7 @@ run your manager node. For example, the tutorial uses a machine named helloworld ``` -3. Run `docker service inspect ` to verify that the swarm manager +3. Run `docker service inspect ` to verify that the swarm manager removed the service. The CLI returns a message that the service is not found: ``` diff --git a/engine/swarm/swarm-tutorial/deploy-service.md b/engine/swarm/swarm-tutorial/deploy-service.md index 45bdd4464a4..232a6c18934 100644 --- a/engine/swarm/swarm-tutorial/deploy-service.md +++ b/engine/swarm/swarm-tutorial/deploy-service.md @@ -1,14 +1,14 @@ ---- -description: Deploy a service to the swarm -keywords: -- tutorial, cluster management, swarm mode -menu: - main: - identifier: deploy-application - parent: swarm-tutorial - weight: 16 -title: Deploy a service ---- + # Deploy a service to the swarm @@ -19,7 +19,7 @@ is not a requirement to deploy a service. 1. Open a terminal and ssh into the machine where you run your manager node. For example, the tutorial uses a machine named `manager1`. -2. Run the the following command: +2. Run the the following command: ```bash $ docker service create --replicas 1 --name helloworld alpine ping docker.com @@ -33,7 +33,7 @@ example, the tutorial uses a machine named `manager1`. * The arguments `alpine ping docker.com` define the service as an Alpine Linux container that executes the command `ping docker.com`. -3. Run `docker service ls` to see the list of running services: +3. Run `docker service ls` to see the list of running services: ``` $ docker service ls diff --git a/engine/swarm/swarm-tutorial/drain-node.md b/engine/swarm/swarm-tutorial/drain-node.md index fce0ab87fa7..5e1c86097a2 100644 --- a/engine/swarm/swarm-tutorial/drain-node.md +++ b/engine/swarm/swarm-tutorial/drain-node.md @@ -1,14 +1,14 @@ ---- -description: Drain nodes on the swarm -keywords: -- tutorial, cluster management, swarm, service, drain -menu: - main: - identifier: swarm-tutorial-drain-node - parent: swarm-tutorial - weight: 21 -title: Drain a node ---- + # Drain a node on the swarm @@ -25,7 +25,7 @@ node and launches replica tasks on a node with `ACTIVE` availability. run your manager node. For example, the tutorial uses a machine named `manager1`. -2. Verify that all your nodes are actively available. +2. Verify that all your nodes are actively available. ```bash $ docker node ls @@ -36,7 +36,7 @@ run your manager node. For example, the tutorial uses a machine named e216jshn25ckzbvmwlnh5jr3g * manager1 Ready Active Leader ``` -3. If you aren't still running the `redis` service from the [rolling +3. If you aren't still running the `redis` service from the [rolling update](rolling-update.md) tutorial, start it now: ```bash @@ -45,22 +45,22 @@ update](rolling-update.md) tutorial, start it now: c5uo6kdmzpon37mgj9mwglcfw ``` -4. Run `docker service ps redis` to see how the swarm manager assigned the +4. Run `docker service ps redis` to see how the swarm manager assigned the tasks to different nodes: ```bash $ docker service ps redis - ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE - 7q92v0nr1hcgts2amcjyqg3pq redis.1 redis redis:3.0.6 Running 26 seconds Running manager1 - 7h2l8h3q3wqy5f66hlv9ddmi6 redis.2 redis redis:3.0.6 Running 26 seconds Running worker1 - 9bg7cezvedmkgg6c8yzvbhwsd redis.3 redis redis:3.0.6 Running 26 seconds Running worker2 + NAME IMAGE NODE DESIRED STATE CURRENT STATE + redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 manager1 Running Running 26 seconds + redis.2.7h2l8h3q3wqy5f66hlv9ddmi6 redis:3.0.6 worker1 Running Running 26 seconds + redis.3.9bg7cezvedmkgg6c8yzvbhwsd redis:3.0.6 worker2 Running Running 26 seconds ``` In this case the swarm manager distributed one task to each node. You may see the tasks distributed differently among the nodes in your environment. -5. Run `docker node update --availability drain ` to drain a node that +5. Run `docker node update --availability drain ` to drain a node that had a task assigned to it: ```bash @@ -69,7 +69,7 @@ had a task assigned to it: worker1 ``` -6. Inspect the node to check its availability: +6. Inspect the node to check its availability: ```bash $ docker node inspect --pretty worker1 @@ -84,24 +84,24 @@ had a task assigned to it: The drained node shows `Drain` for `AVAILABILITY`. -7. Run `docker service ps redis` to see how the swarm manager updated the +7. Run `docker service ps redis` to see how the swarm manager updated the task assignments for the `redis` service: ```bash $ docker service ps redis - ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR - 7q92v0nr1hcgts2amcjyqg3pq redis.1 redis:3.0.6 manager1 Running Running 4 minutes - b4hovzed7id8irg1to42egue8 redis.2 redis:3.0.6 worker2 Running Running About a minute - 7h2l8h3q3wqy5f66hlv9ddmi6 \_ redis.2 redis:3.0.6 worker1 Shutdown Shutdown 2 minutes ago - 9bg7cezvedmkgg6c8yzvbhwsd redis.3 redis:3.0.6 worker2 Running Running 4 minutes + NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR + redis.1.7q92v0nr1hcgts2amcjyqg3pq redis:3.0.6 manager1 Running Running 4 minutes + redis.2.b4hovzed7id8irg1to42egue8 redis:3.0.6 worker2 Running Running About a minute + \_ redis.2.7h2l8h3q3wqy5f66hlv9ddmi6 redis:3.0.6 worker1 Shutdown Shutdown 2 minutes ago + redis.3.9bg7cezvedmkgg6c8yzvbhwsd redis:3.0.6 worker2 Running Running 4 minutes ``` The swarm manager maintains the desired state by ending the task on a node with `Drain` availability and creating a new task on a node with `Active` availability. -8. Run `docker node update --availability active ` to return the +8. Run `docker node update --availability active ` to return the drained node to an active state: ```bash @@ -110,18 +110,18 @@ drained node to an active state: worker1 ``` -9. Inspect the node to see the updated state: +9. Inspect the node to see the updated state: - ```bash - $ docker node inspect --pretty worker1 + ```bash + $ docker node inspect --pretty worker1 - ID: 38ciaotwjuritcdtn9npbnkuz - Hostname: worker1 - Status: + ID: 38ciaotwjuritcdtn9npbnkuz + Hostname: worker1 + Status: State: Ready Availability: Active - ...snip... - ``` + ...snip... + ``` When you set the node back to `Active` availability, it can receive new tasks: diff --git a/engine/swarm/swarm-tutorial/index.md b/engine/swarm/swarm-tutorial/index.md index 54b228f200e..eb807e2f9d1 100644 --- a/engine/swarm/swarm-tutorial/index.md +++ b/engine/swarm/swarm-tutorial/index.md @@ -1,14 +1,14 @@ ---- -description: Getting Started tutorial for Docker Engine swarm mode -keywords: -- tutorial, cluster management, swarm mode -menu: - main: - identifier: tutorial-setup - parent: swarm-tutorial - weight: 11 -title: Set up for the tutorial ---- + # Getting started with swarm mode @@ -33,10 +33,10 @@ If you are brand new to Docker, see [About Docker Engine](../../index.md). To run this tutorial, you need the following: -* [three networked host machines](index.md#three-networked-host-machines) -* [Docker Engine 1.12 or later installed](index.md#docker-engine-1-12-or-newer) -* [the IP address of the manager machine](index.md#the-ip-address-of-the-manager-machine) -* [open ports between the hosts](index.md#open-ports-between-the-hosts) +* [three networked host machines](#three-networked-host-machines) +* [Docker Engine 1.12 or later installed](#docker-engine-1-12-or-newer) +* [the IP address of the manager machine](#the-ip-address-of-the-manager-machine) +* [open ports between the hosts](#open-ports-between-the-hosts) ### Three networked host machines @@ -59,9 +59,9 @@ Install Docker Engine and verify that the Docker Engine daemon is running on each of the machines. You can get the latest version of Docker Engine as follows: -* [install Docker Engine on Linux machines](index.md#install-docker-engine-on-linux-machines) +* [install Docker Engine on Linux machines](#install-docker-engine-on-linux-machines) -* [use Docker for Mac or Docker for Windows](index.md#use-docker-for-mac-or-docker-for-windows) +* [use Docker for Mac or Docker for Windows](#use-docker-for-mac-or-docker-for-windows) #### Install Docker Engine on Linux machines diff --git a/engine/swarm/swarm-tutorial/inspect-service.md b/engine/swarm/swarm-tutorial/inspect-service.md index aad3687ecf9..fbdf1fd21ba 100644 --- a/engine/swarm/swarm-tutorial/inspect-service.md +++ b/engine/swarm/swarm-tutorial/inspect-service.md @@ -1,14 +1,14 @@ ---- -description: Inspect the application -keywords: -- tutorial, cluster management, swarm mode -menu: - main: - identifier: inspect-application - parent: swarm-tutorial - weight: 17 -title: Inspect the service ---- + # Inspect a service on the swarm @@ -19,7 +19,7 @@ the Docker CLI to see details about the service running in the swarm. run your manager node. For example, the tutorial uses a machine named `manager1`. -2. Run `docker service inspect --pretty ` to display the details +2. Run `docker service inspect --pretty ` to display the details about a service in an easily readable format. To see the details on the `helloworld` service: @@ -29,7 +29,7 @@ about a service in an easily readable format. ID: 9uk4639qpg7npwf3fn2aasksr Name: helloworld - Mode: REPLICATED + Service Mode: REPLICATED Replicas: 1 Placement: UpdateConfig: @@ -37,12 +37,14 @@ about a service in an easily readable format. ContainerSpec: Image: alpine Args: ping docker.com + Resources: + Endpoint Mode: vip ``` >**Tip**: To return the service details in json format, run the same command without the `--pretty` flag. - ```json + ``` $ docker service inspect helloworld [ { @@ -91,14 +93,14 @@ about a service in an easily readable format. ] ``` -4. Run `docker service ps ` to see which nodes are running the +4. Run `docker service ps ` to see which nodes are running the service: ``` $ docker service ps helloworld - ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE - 8p1vev3fq5zm0mi8g0as41w35 helloworld.1 helloworld alpine Running 3 minutes Running worker2 + NAME IMAGE NODE DESIRED STATE LAST STATE + helloworld.1.8p1vev3fq5zm0mi8g0as41w35 alpine worker2 Running Running 3 minutes ``` In this case, the one instance of the `helloworld` service is running on the @@ -109,7 +111,7 @@ service: task so you can see if tasks are running according to the service definition. -4. Run `docker ps` on the node where the task is running to see details about +4. Run `docker ps` on the node where the task is running to see details about the container for the task. >**Tip**: If `helloworld` is running on a node other than your manager node, diff --git a/engine/swarm/swarm-tutorial/menu.md b/engine/swarm/swarm-tutorial/menu.md index 9b48a0a3db7..17bc2c882d2 100644 --- a/engine/swarm/swarm-tutorial/menu.md +++ b/engine/swarm/swarm-tutorial/menu.md @@ -1,15 +1,15 @@ ---- -description: Getting started tutorial for Docker swarm mode -keywords: -- cluster, swarm, tutorial -menu: - main: - identifier: swarm-tutorial - parent: engine_swarm - weight: 10 -title: Get started with swarm mode -type: menu ---- + # Docker Engine swarm mode getting started tutorial diff --git a/engine/swarm/swarm-tutorial/rolling-update.md b/engine/swarm/swarm-tutorial/rolling-update.md index fc4ff6b23d8..51e6289064e 100644 --- a/engine/swarm/swarm-tutorial/rolling-update.md +++ b/engine/swarm/swarm-tutorial/rolling-update.md @@ -1,14 +1,14 @@ ---- -description: Apply rolling updates to a service on the swarm -keywords: -- tutorial, cluster management, swarm, service, rolling-update -menu: - main: - identifier: swarm-tutorial-rolling-update - parent: swarm-tutorial - weight: 20 -title: Apply rolling updates ---- + # Apply rolling updates to a service @@ -21,7 +21,7 @@ Redis 3.0.7 container image using rolling updates. run your manager node. For example, the tutorial uses a machine named `manager1`. -2. Deploy Redis 3.0.6 to the swarm and configure the swarm with a 10 second +2. Deploy Redis 3.0.6 to the swarm and configure the swarm with a 10 second update delay: ```bash @@ -52,14 +52,14 @@ update delay: `--update-failure-action` flag for `docker service create` or `docker service update`. -3. Inspect the `redis` service: +3. Inspect the `redis` service: ```bash $ docker service inspect --pretty redis ID: 0u6a4s31ybk7yw2wyvtikmu50 Name: redis - Mode: Replicated + Service Mode: Replicated Replicas: 3 Placement: Strategy: Spread @@ -69,9 +69,10 @@ update delay: ContainerSpec: Image: redis:3.0.6 Resources: + Endpoint Mode: vip ``` -4. Now you can update the container image for `redis`. The swarm manager +4. Now you can update the container image for `redis`. The swarm manager applies the update to nodes according to the `UpdateConfig` policy: ```bash @@ -89,7 +90,7 @@ applies the update to nodes according to the `UpdateConfig` policy: * If, at any time during the update, a task returns `FAILED`, pause the update. -5. Run `docker service inspect --pretty redis` to see the new image in the +5. Run `docker service inspect --pretty redis` to see the new image in the desired state: ```bash @@ -97,7 +98,7 @@ desired state: ID: 0u6a4s31ybk7yw2wyvtikmu50 Name: redis - Mode: Replicated + Service Mode: Replicated Replicas: 3 Placement: Strategy: Spread @@ -107,6 +108,7 @@ desired state: ContainerSpec: Image: redis:3.0.7 Resources: + Endpoint Mode: vip ``` The output of `service inspect` shows if your update paused due to failure: @@ -133,18 +135,18 @@ desired state: To avoid repeating certain update failures, you may need to reconfigure the service by passing flags to `docker service update`. -6. Run `docker service ps ` to watch the rolling update: +6. Run `docker service ps ` to watch the rolling update: ```bash $ docker service ps redis - ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR - dos1zffgeofhagnve8w864fco redis.1 redis:3.0.7 worker1 Running Running 37 seconds - 88rdo6pa52ki8oqx6dogf04fh \_ redis.1 redis:3.0.6 worker2 Shutdown Shutdown 56 seconds ago - 9l3i4j85517skba5o7tn5m8g0 redis.2 redis:3.0.7 worker2 Running Running About a minute - 66k185wilg8ele7ntu8f6nj6i \_ redis.2 redis:3.0.6 worker1 Shutdown Shutdown 2 minutes ago - egiuiqpzrdbxks3wxgn8qib1g redis.3 redis:3.0.7 worker1 Running Running 48 seconds - ctzktfddb2tepkr45qcmqln04 \_ redis.3 redis:3.0.6 mmanager1 Shutdown Shutdown 2 minutes ago + NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR + redis.1.dos1zffgeofhagnve8w864fco redis:3.0.7 worker1 Running Running 37 seconds + \_ redis.1.88rdo6pa52ki8oqx6dogf04fh redis:3.0.6 worker2 Shutdown Shutdown 56 seconds ago + redis.2.9l3i4j85517skba5o7tn5m8g0 redis:3.0.7 worker2 Running Running About a minute + \_ redis.2.66k185wilg8ele7ntu8f6nj6i redis:3.0.6 worker1 Shutdown Shutdown 2 minutes ago + redis.3.egiuiqpzrdbxks3wxgn8qib1g redis:3.0.7 worker1 Running Running 48 seconds + \_ redis.3.ctzktfddb2tepkr45qcmqln04 redis:3.0.6 mmanager1 Shutdown Shutdown 2 minutes ago ``` Before Swarm updates all of the tasks, you can see that some are running diff --git a/engine/swarm/swarm-tutorial/scale-service.md b/engine/swarm/swarm-tutorial/scale-service.md index 34bd03a1085..9418f0e2a93 100644 --- a/engine/swarm/swarm-tutorial/scale-service.md +++ b/engine/swarm/swarm-tutorial/scale-service.md @@ -1,14 +1,14 @@ ---- -description: Scale the service running in the swarm -keywords: -- tutorial, cluster management, swarm mode, scale -menu: - main: - identifier: swarm-tutorial-scale-service - parent: swarm-tutorial - weight: 18 -title: Scale the service ---- + # Scale the service in the swarm @@ -20,7 +20,7 @@ the swarm. run your manager node. For example, the tutorial uses a machine named `manager1`. -2. Run the following command to change the desired state of the +2. Run the following command to change the desired state of the service running in the swarm: ```bash @@ -35,24 +35,24 @@ service running in the swarm: helloworld scaled to 5 ``` -3. Run `docker service ps ` to see the updated task list: +3. Run `docker service ps ` to see the updated task list: ``` $ docker service ps helloworld - ID NAME SERVICE IMAGE LAST STATE DESIRED STATE NODE - 8p1vev3fq5zm0mi8g0as41w35 helloworld.1 helloworld alpine Running 7 minutes Running worker2 - c7a7tcdq5s0uk3qr88mf8xco6 helloworld.2 helloworld alpine Running 24 seconds Running worker1 - 6crl09vdcalvtfehfh69ogfb1 helloworld.3 helloworld alpine Running 24 seconds Running worker1 - auky6trawmdlcne8ad8phb0f1 helloworld.4 helloworld alpine Running 24 seconds Accepted manager1 - ba19kca06l18zujfwxyc5lkyn helloworld.5 helloworld alpine Running 24 seconds Running worker2 + NAME IMAGE NODE DESIRED STATE CURRENT STATE + helloworld.1.8p1vev3fq5zm0mi8g0as41w35 alpine worker2 Running Running 7 minutes + helloworld.2.c7a7tcdq5s0uk3qr88mf8xco6 alpine worker1 Running Running 24 seconds + helloworld.3.6crl09vdcalvtfehfh69ogfb1 alpine worker1 Running Running 24 seconds + helloworld.4.auky6trawmdlcne8ad8phb0f1 alpine manager1 Running Running 24 seconds + helloworld.5.ba19kca06l18zujfwxyc5lkyn alpine worker2 Running Running 24 seconds ``` You can see that swarm has created 4 new tasks to scale to a total of 5 running instances of Alpine Linux. The tasks are distributed between the three nodes of the swarm. One is running on `manager1`. -4. Run `docker ps` to see the containers running on the node where you're +4. Run `docker ps` to see the containers running on the node where you're connected. The following example shows the tasks running on `manager1`: ``` diff --git a/engine/tutorials/dockerimages.md b/engine/tutorials/dockerimages.md index 45b00a085ea..7489ef3e4dd 100644 --- a/engine/tutorials/dockerimages.md +++ b/engine/tutorials/dockerimages.md @@ -1,18 +1,17 @@ ---- -aliases: -- /engine/userguide/containers/dockerimages/ -- /engine/userguide/dockerimages/ -description: How to work with Docker images. -keywords: -- documentation, docs, the docker guide, docker guide, docker, docker platform, docker.io, - Docker images, Docker image, image management, Docker repos, Docker repositories, - docker, docker tag, docker tags, Docker Hub, collaboration -menu: - main: - parent: engine_learn_menu - weight: -4 -title: Build your own images ---- + # Build your own images @@ -265,7 +264,6 @@ building your own Sinatra image for your fictitious development team. # This is a comment FROM ubuntu:14.04 - MAINTAINER Kate Smith RUN apt-get update && apt-get install -y ruby ruby-dev RUN gem install sinatra @@ -277,7 +275,7 @@ is capitalized. > **Note:** You use `#` to indicate a comment The first instruction `FROM` tells Docker what the source of our image is, in -this case you're basing our new image on an Ubuntu 14.04 image. The instruction uses the `MAINTAINER` instruction to specify who maintains the new image. +this case you're basing our new image on an Ubuntu 14.04 image. Lastly, you've specified two `RUN` instructions. A `RUN` instruction executes a command inside the image, for example installing a package. Here you're @@ -294,10 +292,7 @@ Now let's take our `Dockerfile` and use the `docker build` command to build an i Sending build context to Docker daemon Step 1 : FROM ubuntu:14.04 ---> e54ca5efa2e9 - Step 2 : MAINTAINER Kate Smith - ---> Using cache - ---> 851baf55332b - Step 3 : RUN apt-get update && apt-get install -y ruby ruby-dev + Step 2 : RUN apt-get update && apt-get install -y ruby ruby-dev ---> Running in 3a2558904e9b Selecting previously unselected package libasan0:amd64. (Reading database ... 11518 files and directories currently installed.) @@ -432,7 +427,7 @@ Now let's take our `Dockerfile` and use the `docker build` command to build an i Running hooks in /etc/ca-certificates/update.d....done. ---> c55c31703134 Removing intermediate container 3a2558904e9b - Step 4 : RUN gem install sinatra + Step 3 : RUN gem install sinatra ---> Running in 6b81cb6313e5 unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping unable to convert "\xC3" to UTF-8 in conversion from ASCII-8BIT to UTF-8 to US-ASCII for README.rdoc, skipping @@ -473,7 +468,7 @@ step-by-step. You can see that each step creates a new container, runs the instruction inside that container and then commits that change - just like the `docker commit` work flow you saw earlier. When all the instructions have executed you're left with the `97feabe5d2ed` image -(also helpfully tagged as `ouruser/sinatra:v2`) and all intermediate +(also helpfuly tagged as `ouruser/sinatra:v2`) and all intermediate containers will get removed to clean things up. > **Note:** diff --git a/engine/tutorials/dockerizing.md b/engine/tutorials/dockerizing.md index 7c60b0a83cd..6295319d93e 100644 --- a/engine/tutorials/dockerizing.md +++ b/engine/tutorials/dockerizing.md @@ -1,17 +1,17 @@ ---- -aliases: -- /engine/userguide/containers/dockerizing/ -- /engine/userguide/dockerizing/ -description: A simple 'Hello world' exercise that introduced you to Docker. -keywords: -- docker guide, docker, docker platform, how to, dockerize, dockerizing apps, dockerizing - applications, container, containers -menu: - main: - parent: engine_learn_menu - weight: -6 -title: Hello world in a container ---- + # Hello world in a container diff --git a/engine/tutorials/dockerrepos.md b/engine/tutorials/dockerrepos.md index a15ea11884f..b1d76b326d9 100644 --- a/engine/tutorials/dockerrepos.md +++ b/engine/tutorials/dockerrepos.md @@ -1,16 +1,16 @@ ---- -aliases: -- /engine/userguide/containers/dockerrepos/ -- /engine/userguide/dockerrepos/ -description: Learn how to use the Docker Hub to manage Docker images and work flow -keywords: -- repo, Docker Hub, Docker Hub, registry, index, repositories, usage, pull image, - push image, image, documentation -menu: - main: - parent: engine_learn_menu -title: Store images on Docker Hub ---- + # Store images on Docker Hub diff --git a/engine/tutorials/dockervolumes.md b/engine/tutorials/dockervolumes.md index 2fb53870480..307e5d54d66 100644 --- a/engine/tutorials/dockervolumes.md +++ b/engine/tutorials/dockervolumes.md @@ -1,15 +1,16 @@ ---- -aliases: -- /engine/userguide/containers/dockervolumes/ -- /engine/userguide/dockervolumes/ -description: How to manage data inside your Docker containers. -keywords: -- Examples, Usage, volume, docker, documentation, user guide, data, volumes -menu: - main: - parent: engine_learn_menu -title: Manage data in containers ---- + # Manage data in containers @@ -34,7 +35,7 @@ containers that bypasses the [*Union File System*](../reference/glossary.md#unio - Volumes are initialized when a container is created. If the container's base image contains data at the specified mount point, that existing data is copied into the new volume upon volume initialization. (Note that this does - not apply when [mounting a host directory](dockervolumes.md#mount-a-host-directory-as-a-data-volume).) + not apply when [mounting a host directory](#mount-a-host-directory-as-a-data-volume).) - Data volumes can be shared and reused among containers. - Changes to a data volume are made directly. - Changes to a data volume will not be included when you update an image. diff --git a/engine/tutorials/index.md b/engine/tutorials/index.md index 7581c320ff7..97f66056295 100644 --- a/engine/tutorials/index.md +++ b/engine/tutorials/index.md @@ -1,15 +1,16 @@ ---- -aliases: -- /engine/userguide/containers/ -description: Explains how to work with containers -identifier: engine_learn -keywords: -- docker, introduction, documentation, about, technology, docker.io, user, guide, - user's, manual, platform, framework, home, intro -parent: engine_learn_menu -title: Learn by example -weight: "-80" ---- + # Learn by example diff --git a/engine/tutorials/menu.md b/engine/tutorials/menu.md index f6f74caf6d6..febc955ac90 100644 --- a/engine/tutorials/menu.md +++ b/engine/tutorials/menu.md @@ -1,16 +1,16 @@ ---- -aliases: [] -description: Explains how to work with containers -keywords: -- docker, introduction, documentation, about, technology, docker.io, user, guide, - user's, manual, platform, framework, home, intro -menu: - main: - identifier: engine_learn_menu - parent: engine_use - weight: -79 -title: Learn by example -type: menu ---- + # Learn by example diff --git a/engine/tutorials/networkingcontainers.md b/engine/tutorials/networkingcontainers.md index 65c2a5d88c2..c4cdf4b2f20 100644 --- a/engine/tutorials/networkingcontainers.md +++ b/engine/tutorials/networkingcontainers.md @@ -1,16 +1,18 @@ ---- -aliases: -- /engine/userguide/containers/networkigncontainers/ -- /engine/userguide/networkigncontainers/ -description: How to network Docker containers. -keywords: -- Examples, Usage, volume, docker, documentation, user guide, data, volumes -menu: - main: - parent: engine_learn_menu - weight: -3 -title: Network containers ---- + + # Network containers @@ -139,7 +141,8 @@ $ docker network inspect bridge "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", "com.docker.network.bridge.name": "docker0", "com.docker.network.driver.mtu": "9001" - } + }, + "Labels": {} } ] ``` @@ -181,12 +184,13 @@ If you inspect the network, you'll find that it has nothing in it. "Config": [ { "Subnet": "172.18.0.0/16", - "Gateway": "172.18.0.1/16" + "Gateway": "172.18.0.1" } ] }, "Containers": {}, - "Options": {} + "Options": {}, + "Labels": {} } ] @@ -203,9 +207,7 @@ Launch a container running a PostgreSQL database and pass it the `--network=my-b If you inspect your `my-bridge-network` you'll see it has a container attached. You can also inspect your container to see where it is connected: - {% raw %} $ docker inspect --format='{{json .NetworkSettings.Networks}}' db - {% endraw %} {"my-bridge-network":{"NetworkID":"7d86d31b1478e7cca9ebed7e73aa0fdeec46c5ca29497431d3007d2d9e15ed99", "EndpointID":"508b170d56b2ac9e4ef86694b0a76a22dd3df1983404f7321da5649645bf7043","Gateway":"172.18.0.1","IPAddress":"172.18.0.2","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:11:00:02"}} @@ -216,18 +218,14 @@ Now, go ahead and start your by now familiar web application. This time leave of Which network is your `web` application running under? Inspect the application and you'll find it is running in the default `bridge` network. - {% raw %} $ docker inspect --format='{{json .NetworkSettings.Networks}}' web - {% endraw %} {"bridge":{"NetworkID":"7ea29fc1412292a2d7bba362f9253545fecdfa8ce9a6e37dd10ba8bee7129812", "EndpointID":"508b170d56b2ac9e4ef86694b0a76a22dd3df1983404f7321da5649645bf7043","Gateway":"172.17.0.1","IPAddress":"172.17.0.2","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:11:00:02"}} Then, get the IP address of your `web` - {% raw %} $ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' web - {% endraw %} 172.17.0.2 diff --git a/engine/tutorials/usingdocker.md b/engine/tutorials/usingdocker.md index f94bbf7d018..91ca148f693 100644 --- a/engine/tutorials/usingdocker.md +++ b/engine/tutorials/usingdocker.md @@ -1,16 +1,16 @@ ---- -aliases: -- /engine/userguide/containers/usingdocker/ -description: Learn how to manage and operate Docker containers. -keywords: -- docker, the docker guide, documentation, docker.io, monitoring containers, docker - top, docker inspect, docker port, ports, docker logs, log, Logs -menu: - main: - parent: engine_learn_menu - weight: -5 -title: Run a simple application ---- + # Run a simple application @@ -250,9 +250,7 @@ You can see a sample of that JSON output. We can also narrow down the information we want to return by requesting a specific element, for example to return the container's IP address we would: - {% raw %} $ docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' nostalgic_morse - {% endraw %} 172.17.0.5 diff --git a/engine/understanding-docker.md b/engine/understanding-docker.md index 872739d7153..08efa688f84 100644 --- a/engine/understanding-docker.md +++ b/engine/understanding-docker.md @@ -1,17 +1,18 @@ ---- -aliases: -- /introduction/understanding-docker/ -- /engine/userguide/basics/ -- /engine/quickstart.md -description: Docker explained in depth -keywords: -- docker, introduction, documentation, about, technology, understanding -menu: - main: - parent: engine_use - weight: -90 -title: Docker Overview ---- + # Docker Overview Docker is an open platform for developing, shipping, and running applications. @@ -126,7 +127,7 @@ Apache web server and your web application installed. You can build or update images from scratch or download and use images created by others. An image may be based on, or may extend, one or more other images. A docker image is described in text file called a _Dockerfile_, which has a simple, well-defined syntax. For more -details about images, see [How does a Docker image work?](understanding-docker.md#how-does-a-docker-image-work). +details about images, see [How does a Docker image work?](#how-does-a-docker-image-work). Docker images are the **build** component of Docker. @@ -137,7 +138,7 @@ a container, you can provide configuration metadata such as networking informati or environment variables. Each container is an isolated and secure application platform, but can be given access to resources running in a different host or container, as well as persistent storage or databases. For more details about -containers, see [How does a container work?](understanding-docker.md#how-does-a-container-work). +containers, see [How does a container work?](#how-does-a-container-work). Docker containers are the **run** component of Docker. @@ -145,7 +146,7 @@ Docker containers are the **run** component of Docker. A docker registry is a library of images. A registry can be public or private, and can be on the same server as the Docker daemon or Docker client, or on a totally separate server. For more details about registries, see -[How does a Docker registry work?](understanding-docker.md#how-does-a-docker-registry-work) +[How does a Docker registry work?](#how-does-a-docker-registry-work) Docker registries are the **distribution** component of Docker. diff --git a/engine/userguide/eng-image/baseimages.md b/engine/userguide/eng-image/baseimages.md index a3e7989d775..86be42e6897 100644 --- a/engine/userguide/eng-image/baseimages.md +++ b/engine/userguide/eng-image/baseimages.md @@ -1,14 +1,13 @@ ---- -aliases: -- /engine/articles/baseimages/ -description: How to create base images -keywords: -- Examples, Usage, base image, docker, documentation, examples -menu: - main: - parent: engine_images -title: Create a base image ---- + # Create a base image diff --git a/engine/userguide/eng-image/dockerfile_best-practices.md b/engine/userguide/eng-image/dockerfile_best-practices.md index f0db0cf6b68..58f1b46d276 100644 --- a/engine/userguide/eng-image/dockerfile_best-practices.md +++ b/engine/userguide/eng-image/dockerfile_best-practices.md @@ -1,17 +1,13 @@ ---- -aliases: -- /engine/articles/dockerfile_best-practices/ -- /docker-cloud/getting-started/intermediate/optimize-dockerfiles/ -- /docker-cloud/tutorials/optimize-dockerfiles/ -description: Hints, tips and guidelines for writing clean, reliable Dockerfiles -keywords: -- Examples, Usage, base image, docker, documentation, dockerfile, best practices, - hub, official repo -menu: - main: - parent: engine_images -title: Best practices for writing Dockerfiles ---- + # Best practices for writing Dockerfiles diff --git a/engine/userguide/eng-image/image_management.md b/engine/userguide/eng-image/image_management.md index d531f13e57c..035b6b681a3 100644 --- a/engine/userguide/eng-image/image_management.md +++ b/engine/userguide/eng-image/image_management.md @@ -1,16 +1,14 @@ ---- -alias: -- /reference/api/hub_registry_spec/ -- /userguide/image_management/ -description: Documentation for docker Registry and Registry API -keywords: -- docker, registry, api, hub -menu: - main: - parent: engine_images - weight: 90 -title: Image management ---- + # Image management diff --git a/engine/userguide/eng-image/index.md b/engine/userguide/eng-image/index.md index 33e771910c4..c46eec6b592 100644 --- a/engine/userguide/eng-image/index.md +++ b/engine/userguide/eng-image/index.md @@ -1,14 +1,13 @@ ---- -description: The Docker user guide home page -keywords: -- docker, introduction, documentation, about, technology, docker.io, user, guide, - user's, manual, platform, framework, home, intro -menu: - main: - identifier: engine_images - parent: engine_guide -title: Work with images ---- + # Work with images diff --git a/engine/userguide/index.md b/engine/userguide/index.md index d90bd5b0910..99a41e77a0f 100644 --- a/engine/userguide/index.md +++ b/engine/userguide/index.md @@ -1,15 +1,14 @@ ---- -description: How to use the Docker Engine user guide -keywords: -- engine, introduction, documentation, about, technology, docker, user, guide, framework, - home, intro -menu: - main: - identifier: engine_guide - parent: engine_use - weight: "-78" -title: User Guide ---- + # Docker Engine user guide diff --git a/engine/userguide/intro.md b/engine/userguide/intro.md index 9c1b720a37d..80606e32f36 100644 --- a/engine/userguide/intro.md +++ b/engine/userguide/intro.md @@ -1,16 +1,13 @@ ---- -aliases: - - /userguide/ -description: Introduction to user guide -identifier: engine_guide_intro -keywords: -- docker, introduction, documentation, about, technology, docker.io, user, guide, - user's, manual, platform, framework, home, intro -menu: - main: - parent: engine_guide -title: Introduction ---- + # Engine user guide diff --git a/engine/userguide/labels-custom-metadata.md b/engine/userguide/labels-custom-metadata.md index 1908c7f251e..63d20342910 100644 --- a/engine/userguide/labels-custom-metadata.md +++ b/engine/userguide/labels-custom-metadata.md @@ -1,13 +1,13 @@ ---- -description: Description of labels, which are used to manage metadata on Docker objects. -keywords: -- Usage, user guide, labels, metadata, docker, documentation, examples, annotating -menu: - main: - parent: engine_guide - weight: 100 -title: Managing Docker object labels ---- + # About labels diff --git a/engine/userguide/networking/configure-dns.md b/engine/userguide/networking/configure-dns.md index ed95f0bb238..434688d6367 100644 --- a/engine/userguide/networking/configure-dns.md +++ b/engine/userguide/networking/configure-dns.md @@ -1,12 +1,12 @@ ---- -description: Learn how to configure DNS in user-defined networks -keywords: -- docker, DNS, network -menu: - main: - parent: smn_networking -title: Configure container DNS in user-defined networks ---- + # Embedded DNS server in user-defined networks @@ -30,14 +30,94 @@ the files alone and use the following Docker options instead. Various container options that affect container domain name services. -| Options | Description | -| ------- | ----------- | -| `--name=CONTAINER-NAME` | Container name configured using `--name` is used to discover a container within an user-defined docker network. The embedded DNS server maintains the mapping between the container name and its IP address (on the network the container is connected to). | -| `--network-alias=ALIAS` | In addition to `--name` as described above, a container is discovered by one or more of its configured `--network-alias` (or `--alias` in docker network connect command) within the user-defined network. The embedded DNS server maintains the mapping between all of the container aliases and its IP address on a specific user-defined network. A container can have different aliases in different networks by using the `--alias` option in docker network connect command. | -| `--link=CONTAINER_NAME:ALIAS` | Using this option as you run a container gives the embedded DNS an extra entry named ALIAS that points to the IP address of the container identified by CONTAINER_NAME. When using `--link` the embedded DNS will guarantee that localized lookup result only on that container where the `--link` is used. This lets processes inside the new container connect to container without having to know its name or IP. | -| `--dns=[IP_ADDRESS...]` | The IP addresses passed via the `--dns` option is used by the embedded DNS server to forward the DNS query if embedded DNS server is unable to resolve a name resolution request from the containers. These `--dns` IP addresses are managed by the embedded DNS server and will not be updated in the container's `/etc/resolv.conf` file.| -| `--dns-search=DOMAIN...` | Sets the domain names that are searched when a bare unqualified hostname isused inside of the container. These `--dns-search` options are managed by the embedded DNS server and will not be updated in the container's `/etc/resolv.conf` file. When a container process attempts to access host and the search domain `example.com` is set, for instance, the DNS logic will not only look up host but also `host.example.com`. | -| `--dns-opt=OPTION...` |Sets the options used by DNS resolvers. These options are managed by the embedded DNS server and will not be updated in the container's `/etc/resolv.conf` file. See documentation for resolv.conf for a list of valid options | + + + + + + + + + + + + + + + + + + + + + + + + +
+

+ --name=CONTAINER-NAME +

+
+

+ Container name configured using --name is used to discover a container within + an user-defined docker network. The embedded DNS server maintains the mapping between + the container name and its IP address (on the network the container is connected to). +

+
+

+ --network-alias=ALIAS +

+
+

+ In addition to --name as described above, a container is discovered by one or more + of its configured --network-alias (or --alias in docker network connect command) + within the user-defined network. The embedded DNS server maintains the mapping between + all of the container aliases and its IP address on a specific user-defined network. + A container can have different aliases in different networks by using the --alias + option in docker network connect command. +

+
+

+ --link=CONTAINER_NAME:ALIAS +

+
+

+ Using this option as you run a container gives the embedded DNS + an extra entry named ALIAS that points to the IP address + of the container identified by CONTAINER_NAME. When using --link + the embedded DNS will guarantee that localized lookup result only on that + container where the --link is used. This lets processes inside the new container + connect to container without having to know its name or IP. +

+

+ --dns=[IP_ADDRESS...] +

+ The IP addresses passed via the --dns option is used by the embedded DNS + server to forward the DNS query if embedded DNS server is unable to resolve a name + resolution request from the containers. + These --dns IP addresses are managed by the embedded DNS server and + will not be updated in the container's /etc/resolv.conf file. +

+ --dns-search=DOMAIN... +

+ Sets the domain names that are searched when a bare unqualified hostname is + used inside of the container. These --dns-search options are managed by the + embedded DNS server and will not be updated in the container's /etc/resolv.conf file. + When a container process attempts to access host and the search + domain example.com is set, for instance, the DNS logic will not only + look up host but also host.example.com. +

+

+ --dns-opt=OPTION... +

+ Sets the options used by DNS resolvers. These options are managed by the embedded + DNS server and will not be updated in the container's /etc/resolv.conf file. +

+

+ See documentation for resolv.conf for a list of valid options +

+ In the absence of the `--dns=IP_ADDRESS...`, `--dns-search=DOMAIN...`, or `--dns-opt=OPTION...` options, Docker uses the `/etc/resolv.conf` of the diff --git a/engine/userguide/networking/default_network/binding.md b/engine/userguide/networking/default_network/binding.md index babd1f595f3..21977845257 100644 --- a/engine/userguide/networking/default_network/binding.md +++ b/engine/userguide/networking/default_network/binding.md @@ -1,12 +1,12 @@ ---- -description: expose, port, docker, bind publish -keywords: -- Examples, Usage, network, docker, documentation, user guide, multihost, cluster -menu: - main: - parent: smn_networking_def -title: Bind container ports to the host ---- + # Bind container ports to the host diff --git a/engine/userguide/networking/default_network/build-bridges.md b/engine/userguide/networking/default_network/build-bridges.md index 9f4d2aad6f8..7f7cb4451f2 100644 --- a/engine/userguide/networking/default_network/build-bridges.md +++ b/engine/userguide/networking/default_network/build-bridges.md @@ -1,12 +1,12 @@ ---- -description: Learn how to build your own bridge interface -keywords: -- docker, bridge, docker0, network -menu: - main: - parent: smn_networking_def -title: Build your own bridge ---- + # Build your own bridge diff --git a/engine/userguide/networking/default_network/configure-dns.md b/engine/userguide/networking/default_network/configure-dns.md index b426abf23d7..c5e0c09a860 100644 --- a/engine/userguide/networking/default_network/configure-dns.md +++ b/engine/userguide/networking/default_network/configure-dns.md @@ -1,12 +1,12 @@ ---- -description: Learn how to configure DNS in Docker -keywords: -- docker, bridge, docker0, network -menu: - main: - parent: smn_networking_def -title: Configure container DNS ---- + # Configure container DNS @@ -104,13 +104,17 @@ Four different options affect container domain name services. --dns-opt=OPTION...

- Sets the options used by DNS resolvers by writing an options - line into the container's /etc/resolv.conf. + Sets the options used by DNS resolvers by writing an options + line into the container's /etc/resolv.conf.

- See documentation for resolv.conf for a list of valid options + See documentation for resolv.conf for a list of valid options

+ +

+

+ diff --git a/engine/userguide/networking/default_network/container-communication.md b/engine/userguide/networking/default_network/container-communication.md index 2a2ebf7ed5a..d49d469c389 100644 --- a/engine/userguide/networking/default_network/container-communication.md +++ b/engine/userguide/networking/default_network/container-communication.md @@ -1,12 +1,12 @@ ---- -description: Understand container communication -keywords: -- docker, container, communication, network -menu: - main: - parent: smn_networking_def -title: Understand container communication ---- + # Understand container communication diff --git a/engine/userguide/networking/default_network/custom-docker0.md b/engine/userguide/networking/default_network/custom-docker0.md index 1e01353ad98..9e90102abde 100644 --- a/engine/userguide/networking/default_network/custom-docker0.md +++ b/engine/userguide/networking/default_network/custom-docker0.md @@ -1,12 +1,12 @@ ---- -description: Customizing docker0 -keywords: -- docker, bridge, docker0, network -menu: - main: - parent: smn_networking_def -title: Customize the docker0 bridge ---- + # Customize the docker0 bridge diff --git a/engine/userguide/networking/default_network/dockerlinks.md b/engine/userguide/networking/default_network/dockerlinks.md index 280891a984d..b465756fea1 100644 --- a/engine/userguide/networking/default_network/dockerlinks.md +++ b/engine/userguide/networking/default_network/dockerlinks.md @@ -1,14 +1,13 @@ ---- -description: Learn how to connect Docker containers together. -keywords: -- Examples, Usage, user guide, links, linking, docker, documentation, examples, names, - name, container naming, port, map, network port, network -menu: - main: - parent: smn_networking_def - weight: -2 -title: Legacy container links ---- + # Legacy container links @@ -190,9 +189,7 @@ example as: Next, inspect your linked containers with `docker inspect`: - {% raw %} $ docker inspect -f "{{ .HostConfig.Links }}" web - {% endraw %} [/db:/web/db] @@ -302,7 +299,7 @@ linked `web` container will be able to talk to the `db` container. ### Important notes on Docker environment variables -Unlike host entries in the [`/etc/hosts` file](dockerlinks.md#updating-the-etchosts-file), +Unlike host entries in the [`/etc/hosts` file](#updating-the-etchosts-file), IP addresses stored in the environment variables are not automatically updated if the source container is restarted. We recommend using the host entries in `/etc/hosts` to resolve the IP address of linked containers. diff --git a/engine/userguide/networking/default_network/index.md b/engine/userguide/networking/default_network/index.md index 78264405155..b72d1b49981 100644 --- a/engine/userguide/networking/default_network/index.md +++ b/engine/userguide/networking/default_network/index.md @@ -1,13 +1,13 @@ ---- -description: Docker networking -keywords: -- network, networking, bridge, docker, documentation -menu: - main: - identifier: smn_networking_def - parent: smn_networking -title: Default bridge network ---- + # Docker default bridge network diff --git a/engine/userguide/networking/default_network/ipv6.md b/engine/userguide/networking/default_network/ipv6.md index cbee5f37ae7..64a1b7e55b3 100644 --- a/engine/userguide/networking/default_network/ipv6.md +++ b/engine/userguide/networking/default_network/ipv6.md @@ -1,13 +1,13 @@ ---- -description: How do we connect docker containers within and across hosts ? -keywords: -- docker, network, IPv6 -menu: - main: - parent: smn_networking_def - weight: 3 -title: IPv6 with Docker ---- + # IPv6 with Docker diff --git a/engine/userguide/networking/get-started-macvlan.md b/engine/userguide/networking/get-started-macvlan.md index 2723efcd4a2..28391c5fdae 100644 --- a/engine/userguide/networking/get-started-macvlan.md +++ b/engine/userguide/networking/get-started-macvlan.md @@ -1,13 +1,13 @@ ---- -description: Use macvlan for container networking -keywords: -- Examples, Usage, network, docker, documentation, user guide, macvlan, cluster -menu: - main: - parent: smn_networking - weight: -3 -title: Get started with macvlan network driver ---- + # Macvlan Network Driver diff --git a/engine/userguide/networking/get-started-overlay.md b/engine/userguide/networking/get-started-overlay.md index 459f0b3f1e6..f924eac7a70 100644 --- a/engine/userguide/networking/get-started-overlay.md +++ b/engine/userguide/networking/get-started-overlay.md @@ -1,13 +1,13 @@ ---- -description: Use overlay for multi-host networking -keywords: -- Examples, Usage, network, docker, documentation, user guide, multihost, cluster -menu: - main: - parent: smn_networking - weight: -3 -title: Get started with multi-host networking ---- + # Get started with multi-host networking @@ -16,11 +16,11 @@ network. Docker Engine supports multi-host networking out-of-the-box through the `overlay` network driver. Unlike `bridge` networks, overlay networks require some pre-existing conditions before you can create one: -* [Docker Engine running in swarm mode](get-started-overlay.md#overlay-networking-and-swarm-mode) +* [Docker Engine running in swarm mode](#overlay-networking-and-swarm-mode) OR -* [A cluster of hosts using a key value store](get-started-overlay.md#overlay-networking-with-an-external-key-value-store) +* [A cluster of hosts using a key value store](#overlay-networking-with-an-external-key-value-store) ## Overlay networking and swarm mode @@ -54,7 +54,7 @@ $ docker service create --replicas 2 --network my-multi-host-network --name my-w Overlay networks for a swarm are not available to unmanaged containers. For more information refer to [Docker swarm mode overlay network security model](overlay-security-model.md). -See also [Attach services to an overlay network](../../swarm/networking.md). +See also [Attach services to an overlay network](../../swarm/networking.md). ## Overlay networking with an external key-value store diff --git a/engine/userguide/networking/index.md b/engine/userguide/networking/index.md index bfc00ed0a0f..c519a2d633f 100644 --- a/engine/userguide/networking/index.md +++ b/engine/userguide/networking/index.md @@ -1,16 +1,17 @@ ---- -aliases: -- /engine/userguide/networking/dockernetworks/ -description: How do we connect docker containers within and across hosts ? -keywords: -- Examples, Usage, network, docker, documentation, user guide, multihost, cluster -menu: - main: - identifier: networking_index - parent: smn_networking - weight: -5 -title: Docker container networking ---- + # Understand Docker container networks @@ -124,7 +125,8 @@ $ docker network inspect bridge "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", "com.docker.network.bridge.name": "docker0", "com.docker.network.driver.mtu": "9001" - } + }, + "Labels": {} } ] ``` @@ -182,7 +184,8 @@ $ docker network inspect bridge "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0", "com.docker.network.bridge.name": "docker0", "com.docker.network.driver.mtu": "9001" - } + }, + "Labels": {} } ] ``` @@ -335,7 +338,8 @@ $ docker network inspect isolated_nw ] }, "Containers": {}, - "Options": {} + "Options": {}, + "Labels": {} } ] @@ -377,7 +381,8 @@ $ docker network inspect isolated_nw "IPv6Address": "" } }, - "Options": {} + "Options": {}, + "Labels": {} } ] ``` diff --git a/engine/userguide/networking/menu.md b/engine/userguide/networking/menu.md index 4cc0ab7a610..f168b70afba 100644 --- a/engine/userguide/networking/menu.md +++ b/engine/userguide/networking/menu.md @@ -1,15 +1,15 @@ ---- -description: Docker networking feature is introduced -keywords: -- network, networking, bridge, docker, documentation -menu: - main: - identifier: smn_networking - parent: engine_guide - weight: 7 -title: Network configuration -type: menu ---- + # Docker networks feature overview diff --git a/engine/userguide/networking/overlay-security-model.md b/engine/userguide/networking/overlay-security-model.md index 717c0b22e60..ab35cd551c2 100644 --- a/engine/userguide/networking/overlay-security-model.md +++ b/engine/userguide/networking/overlay-security-model.md @@ -1,14 +1,13 @@ ---- -description: Docker swarm mode overlay network security model -keywords: -- network, docker, documentation, user guide, multihost, swarm mode -- overlay -menu: - main: - parent: smn_networking - weight: -2 -title: Swarm mode overlay network security model ---- + # Docker swarm mode overlay network security model diff --git a/engine/userguide/networking/work-with-networks.md b/engine/userguide/networking/work-with-networks.md index d6ec3946f5a..d292ce8af53 100644 --- a/engine/userguide/networking/work-with-networks.md +++ b/engine/userguide/networking/work-with-networks.md @@ -1,13 +1,13 @@ ---- -description: How to work with docker networks -keywords: -- commands, Usage, network, docker, cluster -menu: - main: - parent: smn_networking - weight: -4 -title: Work with network commands ---- + # Work with network commands @@ -57,12 +57,13 @@ $ docker network inspect simple-network "Config": [ { "Subnet": "172.22.0.0/16", - "Gateway": "172.22.0.1/16" + "Gateway": "172.22.0.1" } ] }, "Containers": {}, - "Options": {} + "Options": {}, + "Labels": {} } ] ``` @@ -153,14 +154,15 @@ $ docker network inspect my-network "Config": [ { "Subnet": "172.23.0.0/16", - "Gateway": "172.23.0.1/16" + "Gateway": "172.23.0.1" } ] }, "Containers": {}, "Options": { "com.docker.network.bridge.host_binding_ipv4": "172.23.0.1" - } + }, + "Labels": {} } ] @@ -223,7 +225,7 @@ $ docker network inspect isolated_nw "Config": [ { "Subnet": "172.25.0.0/16", - "Gateway": "172.25.0.1/16" + "Gateway": "172.25.0.1" } ] }, @@ -236,7 +238,8 @@ $ docker network inspect isolated_nw "IPv6Address": "" } }, - "Options": {} + "Options": {}, + "Labels": {} } ] ``` @@ -264,15 +267,15 @@ configuration does not change across daemon reload. Now, inspect the network resources used by `container3`. -```bash{% raw %} +```bash $ docker inspect --format='{{json .NetworkSettings.Networks}}' container3 {"isolated_nw":{"IPAMConfig":{"IPv4Address":"172.25.3.3"},"NetworkID":"1196a4c5af43a21ae38ef34515b6af19236a3fc48122cf585e3f3054d509679b", "EndpointID":"dffc7ec2915af58cc827d995e6ebdc897342be0420123277103c40ae35579103","Gateway":"172.25.0.1","IPAddress":"172.25.3.3","IPPrefixLen":16,"IPv6Gateway":"","GlobalIPv6Address":"","GlobalIPv6PrefixLen":0,"MacAddress":"02:42:ac:19:03:03"}} -{% endraw %}``` +``` Repeat this command for `container2`. If you have Python installed, you can pretty print the output. -```bash{% raw %} +```bash $ docker inspect --format='{{json .NetworkSettings.Networks}}' container2 | python -m json.tool { @@ -301,7 +304,7 @@ $ docker inspect --format='{{json .NetworkSettings.Networks}}' container2 | pyt "MacAddress": "02:42:ac:19:00:02" } } -{% endraw %}``` +``` You should find `container2` belongs to two networks. The `bridge` network which it joined by default when you launched it and the `isolated_nw` which you @@ -751,7 +754,7 @@ round-trip min/avg/max = 0.072/0.085/0.101 ms You can disconnect a container from a network using the `docker network disconnect` command. -```bash{% raw %} +```bash $ docker network disconnect isolated_nw container2 $ docker inspect --format='{{json .NetworkSettings.Networks}}' container2 | python -m json.tool @@ -784,7 +787,7 @@ $ docker network inspect isolated_nw "Config": [ { "Subnet": "172.21.0.0/16", - "Gateway": "172.21.0.1/16" + "Gateway": "172.21.0.1" } ] }, @@ -797,10 +800,11 @@ $ docker network inspect isolated_nw "IPv6Address": "" } }, - "Options": {} + "Options": {}, + "Labels": {} } ] -{% endraw %}``` +``` Once a container is disconnected from a network, it cannot communicate with other containers connected to that network. In this example, `container2` can @@ -895,12 +899,13 @@ $ docker network inspect isolated_nw "Config": [ { "Subnet": "172.21.0.0/16", - "Gateway": "172.21.0.1/16" + "Gateway": "172.21.0.1" } ] }, "Containers": {}, - "Options": {} + "Options": {}, + "Labels": {} } ] diff --git a/engine/userguide/storagedriver/aufs-driver.md b/engine/userguide/storagedriver/aufs-driver.md index 22c329f48c6..229cc57926c 100644 --- a/engine/userguide/storagedriver/aufs-driver.md +++ b/engine/userguide/storagedriver/aufs-driver.md @@ -1,12 +1,12 @@ ---- -description: Learn how to optimize your use of AUFS driver. -keywords: -- 'container, storage, driver, AUFS ' -menu: - main: - parent: engine_driver -title: AUFS storage driver in practice ---- + # Docker and AUFS in practice diff --git a/engine/userguide/storagedriver/btrfs-driver.md b/engine/userguide/storagedriver/btrfs-driver.md index e3ec708e658..dd5da2a229e 100644 --- a/engine/userguide/storagedriver/btrfs-driver.md +++ b/engine/userguide/storagedriver/btrfs-driver.md @@ -1,12 +1,12 @@ ---- -description: Learn how to optimize your use of Btrfs driver. -keywords: -- 'container, storage, driver, Btrfs ' -menu: - main: - parent: engine_driver -title: Btrfs storage in practice ---- + # Docker and Btrfs in practice diff --git a/engine/userguide/storagedriver/device-mapper-driver.md b/engine/userguide/storagedriver/device-mapper-driver.md index 49077d6c172..ef445023cad 100644 --- a/engine/userguide/storagedriver/device-mapper-driver.md +++ b/engine/userguide/storagedriver/device-mapper-driver.md @@ -1,12 +1,12 @@ ---- -description: Learn how to optimize your use of device mapper driver. -keywords: -- container, storage, driver, device mapper -menu: - main: - parent: engine_driver -title: Device mapper storage in practice ---- + # Docker and the Device Mapper storage driver @@ -194,7 +194,7 @@ Storage Driver: devicemapper Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata Library Version: 1.02.93-RHEL7 (2015-01-28) [...] -``` + ``` The output above shows a Docker host running with the `devicemapper` storage driver operating in `loop-lvm` mode. This is indicated by the fact that the @@ -210,7 +210,7 @@ you how to configure a Docker host to use the `devicemapper` storage driver in a `direct-lvm` configuration. > **Caution:** If you have already run the Docker daemon on your Docker host -> and have images you want to keep, `push` them Docker Hub or your private +> and have images you want to keep, `push` them to Docker Hub or your private > Docker Trusted Registry before attempting this procedure. The procedure below will create a logical volume configured as a thin pool to @@ -223,126 +223,125 @@ assumes that the Docker daemon is in the `stopped` state. 1. Log in to the Docker host you want to configure and stop the Docker daemon. 2. Install the LVM2 package. - - The LVM2 package includes the userspace toolset that provides logical volume - management facilities on linux. + The LVM2 package includes the userspace toolset that provides logical volume + management facilities on linux. 3. Create a physical volume replacing `/dev/xvdf` with your block device. - ```bash - $ pvcreate /dev/xvdf - ``` + ```bash + $ pvcreate /dev/xvdf + ``` 4. Create a 'docker' volume group. - ```bash - $ vgcreate docker /dev/xvdf - ``` + ```bash + $ vgcreate docker /dev/xvdf + ``` 5. Create a thin pool named `thinpool`. - In this example, the data logical is 95% of the 'docker' volume group size. - Leaving this free space allows for auto expanding of either the data or - metadata if space runs low as a temporary stopgap. + In this example, the data logical is 95% of the 'docker' volume group size. + Leaving this free space allows for auto expanding of either the data or + metadata if space runs low as a temporary stopgap. - ```bash - $ lvcreate --wipesignatures y -n thinpool docker -l 95%VG - $ lvcreate --wipesignatures y -n thinpoolmeta docker -l 1%VG - ``` + ```bash + $ lvcreate --wipesignatures y -n thinpool docker -l 95%VG + $ lvcreate --wipesignatures y -n thinpoolmeta docker -l 1%VG + ``` 6. Convert the pool to a thin pool. - ```bash - $ lvconvert -y --zero n -c 512K --thinpool docker/thinpool --poolmetadata docker/thinpoolmeta - ``` + ```bash + $ lvconvert -y --zero n -c 512K --thinpool docker/thinpool --poolmetadata docker/thinpoolmeta + ``` 7. Configure autoextension of thin pools via an `lvm` profile. - ```bash - $ vi /etc/lvm/profile/docker-thinpool.profile - ``` + ```bash + $ vi /etc/lvm/profile/docker-thinpool.profile + ``` -8. Specify `thin_pool_autoextend_threshold` value. +8. Specify 'thin_pool_autoextend_threshold' value. - The value should be the percentage of space used before `lvm` attempts - to autoextend the available space (100 = disabled). + The value should be the percentage of space used before `lvm` attempts + to autoextend the available space (100 = disabled). - ``` - thin_pool_autoextend_threshold = 80 - ``` + ``` + thin_pool_autoextend_threshold = 80 + ``` 9. Modify the `thin_pool_autoextend_percent` for when thin pool autoextension occurs. - The value's setting is the percentage of space to increase the thin pool (100 = - disabled) + The value's setting is the perentage of space to increase the thin pool (100 = + disabled) - ``` - thin_pool_autoextend_percent = 20 - ``` + ``` + thin_pool_autoextend_percent = 20 + ``` 10. Check your work, your `docker-thinpool.profile` file should appear similar to the following: - An example `/etc/lvm/profile/docker-thinpool.profile` file: + An example `/etc/lvm/profile/docker-thinpool.profile` file: - ``` - activation { - thin_pool_autoextend_threshold=80 - thin_pool_autoextend_percent=20 - } - ``` + ``` + activation { + thin_pool_autoextend_threshold=80 + thin_pool_autoextend_percent=20 + } + ``` 11. Apply your new lvm profile - ```bash - $ lvchange --metadataprofile docker-thinpool docker/thinpool - ``` + ```bash + $ lvchange --metadataprofile docker-thinpool docker/thinpool + ``` 12. Verify the `lv` is monitored. - ```bash - $ lvs -o+seg_monitor - ``` + ```bash + $ lvs -o+seg_monitor + ``` 13. If the Docker daemon was previously started, clear your graph driver directory. - Clearing your graph driver removes any images, containers, and volumes in your - Docker installation. + Clearing your graph driver removes any images, containers, and volumes in your + Docker installation. - ```bash - $ rm -rf /var/lib/docker/* - ``` + ```bash + $ rm -rf /var/lib/docker/* + ``` 14. Configure the Docker daemon with specific devicemapper options. - There are two ways to do this. You can set options on the command line if you start the daemon there: + There are two ways to do this. You can set options on the command line if you start the daemon there: - ```bash - --storage-driver=devicemapper --storage-opt=dm.thinpooldev=/dev/mapper/docker-thinpool --storage-opt dm.use_deferred_removal=true - ``` + ```bash + --storage-driver=devicemapper --storage-opt=dm.thinpooldev=/dev/mapper/docker-thinpool --storage-opt dm.use_deferred_removal=true + ``` - You can also set them for startup in the `daemon.json` configuration, for example: + You can also set them for startup in the `daemon.json` configuration, for example: - ```json - { - "storage-driver": "devicemapper", - "storage-opts": [ - "dm.thinpooldev=/dev/mapper/docker-thinpool", - "dm.use_deferred_removal=true" - ] - } - ``` + ```json + { + "storage-driver": "devicemapper", + "storage-opts": [ + "dm.thinpooldev=/dev/mapper/docker-thinpool", + "dm.use_deferred_removal=true" + ] + } + ``` 15. If using systemd and modifying the daemon configuration via unit or drop-in file, reload systemd to scan for changes. - ```bash - $ systemctl daemon-reload - ``` + ```bash + $ systemctl daemon-reload + ``` 16. Start the Docker daemon. - ```bash - $ systemctl start docker - ``` + ```bash + $ systemctl start docker + ``` After you start the Docker daemon, ensure you monitor your thin pool and volume group free space. While the volume group will auto-extend, it can still fill @@ -454,79 +453,79 @@ The `Data Space` values show that the pool is 100GB total. This example extends 1. List the sizes of the devices. - ```bash - $ sudo ls -lh /var/lib/docker/devicemapper/devicemapper/ + ```bash + $ sudo ls -lh /var/lib/docker/devicemapper/devicemapper/ - total 1175492 - -rw------- 1 root root 100G Mar 30 05:22 data - -rw------- 1 root root 2.0G Mar 31 11:17 metadata - ``` + total 1175492 + -rw------- 1 root root 100G Mar 30 05:22 data + -rw------- 1 root root 2.0G Mar 31 11:17 metadata + ``` 2. Truncate `data` file to the size of the `metadata` file (approximage 200GB). - ```bash - $ sudo truncate -s 214748364800 /var/lib/docker/devicemapper/devicemapper/data - ``` + ```bash + $ sudo truncate -s 214748364800 /var/lib/docker/devicemapper/devicemapper/data + ``` 3. Verify the file size changed. - ```bash - $ sudo ls -lh /var/lib/docker/devicemapper/devicemapper/ + ```bash + $ sudo ls -lh /var/lib/docker/devicemapper/devicemapper/ - total 1.2G - -rw------- 1 root root 200G Apr 14 08:47 data - -rw------- 1 root root 2.0G Apr 19 13:27 metadata - ``` + total 1.2G + -rw------- 1 root root 200G Apr 14 08:47 data + -rw------- 1 root root 2.0G Apr 19 13:27 metadata + ``` 4. Reload data loop device - ```bash - $ sudo blockdev --getsize64 /dev/loop0 + ```bash + $ sudo blockdev --getsize64 /dev/loop0 - 107374182400 + 107374182400 - $ sudo losetup -c /dev/loop0 + $ sudo losetup -c /dev/loop0 - $ sudo blockdev --getsize64 /dev/loop0 + $ sudo blockdev --getsize64 /dev/loop0 - 214748364800 - ``` + 214748364800 + ``` 5. Reload devicemapper thin pool. - 1. Get the pool name first. + a. Get the pool name first. - ```bash - $ sudo dmsetup status | grep pool + ```bash + $ sudo dmsetup status | grep pool - docker-8:1-123141-pool: 0 209715200 thin-pool 91 - 422/524288 18338/1638400 - rw discard_passdown queue_if_no_space - - ``` + docker-8:1-123141-pool: 0 209715200 thin-pool 91 + 422/524288 18338/1638400 - rw discard_passdown queue_if_no_space - + ``` - The name is the string before the colon. + The name is the string before the colon. - 2. Dump the device mapper table first. + b. Dump the device mapper table first. - ```bash - $ sudo dmsetup table docker-8:1-123141-pool + ```bash + $ sudo dmsetup table docker-8:1-123141-pool - 0 209715200 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing - ``` + 0 209715200 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing + ``` - 3. Calculate the real total sectors of the thin pool now. + c. Calculate the real total sectors of the thin pool now. - Change the second number of the table info (i.e. the disk end sector) to - reflect the new number of 512 byte sectors in the disk. For example, as the - new loop size is 200GB, change the second number to 419430400. + Change the second number of the table info (i.e. the disk end sector) to + reflect the new number of 512 byte sectors in the disk. For example, as the + new loop size is 200GB, change the second number to 419430400. - 4. Reload the thin pool with the new sector number + d. Reload the thin pool with the new sector number - ```bash - $ sudo dmsetup suspend docker-8:1-123141-pool \ - && sudo dmsetup reload docker-8:1-123141-pool --table '0 419430400 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing' \ - && sudo dmsetup resume docker-8:1-123141-pool - ``` + ```bash + $ sudo dmsetup suspend docker-8:1-123141-pool \ + && sudo dmsetup reload docker-8:1-123141-pool --table '0 419430400 thin-pool 7:1 7:0 128 32768 1 skip_block_zeroing' \ + && sudo dmsetup resume docker-8:1-123141-pool + ``` #### The device_tool @@ -549,64 +548,63 @@ disk partition. 1. Extend the volume group (VG) `vg-docker`. - ```bash - $ sudo vgextend vg-docker /dev/sdh1 + ```bash + $ sudo vgextend vg-docker /dev/sdh1 - Volume group "vg-docker" successfully extended - ``` + Volume group "vg-docker" successfully extended + ``` - Your volume group may use a different name. + Your volume group may use a different name. 2. Extend the `data` logical volume(LV) `vg-docker/data` - ```bash - $ sudo lvextend -l+100%FREE -n vg-docker/data + ```bash + $ sudo lvextend -l+100%FREE -n vg-docker/data - Extending logical volume data to 200 GiB - Logical volume data successfully resized - ``` + Extending logical volume data to 200 GiB + Logical volume data successfully resized + ``` 3. Reload devicemapper thin pool. - 1. Get the pool name. + a. Get the pool name. - ```bash - $ sudo dmsetup status | grep pool + ```bash + $ sudo dmsetup status | grep pool - docker-253:17-1835016-pool: 0 96460800 thin-pool 51593 6270/1048576 701943/753600 - rw no_discard_passdown queue_if_no_space - ``` + docker-253:17-1835016-pool: 0 96460800 thin-pool 51593 6270/1048576 701943/753600 - rw no_discard_passdown queue_if_no_space + ``` - The name is the string before the colon. + The name is the string before the colon. - 2. Dump the device mapper table. + b. Dump the device mapper table. - ```bash - $ sudo dmsetup table docker-253:17-1835016-pool + ```bash + $ sudo dmsetup table docker-253:17-1835016-pool - 0 96460800 thin-pool 252:0 252:1 128 32768 1 skip_block_zeroing - ``` + 0 96460800 thin-pool 252:0 252:1 128 32768 1 skip_block_zeroing + ``` - 3. Calculate the real total sectors of the thin pool now. we can use `blockdev` to get the real size of data lv. + c. Calculate the real total sectors of the thin pool now. we can use `blockdev` to get the real size of data lv. - Change the second number of the table info (i.e. the number of sectors) to - reflect the new number of 512 byte sectors in the disk. For example, as the - new data `lv` size is `264132100096` bytes, change the second number to - `515883008`. + Change the second number of the table info (i.e. the number of sectors) to + reflect the new number of 512 byte sectors in the disk. For example, as the + new data `lv` size is `264132100096` bytes, change the second number to + `515883008`. - ```bash - $ sudo blockdev --getsize64 /dev/vg-docker/data + ```bash + $ sudo blockdev --getsize64 /dev/vg-docker/data - 264132100096 - ``` + 264132100096 + ``` - 4. Then reload the thin pool with the new sector number. + d. Then reload the thin pool with the new sector number. - ```bash - $ sudo dmsetup suspend docker-253:17-1835016-pool \ - && sudo dmsetup reload docker-253:17-1835016-pool \ - --table '0 515883008 thin-pool 252:0 252:1 128 32768 1 skip_block_zeroing' \ - && sudo dmsetup resume docker-253:17-1835016-pool - ``` + ```bash + $ sudo dmsetup suspend docker-253:17-1835016-pool \ + && sudo dmsetup reload docker-253:17-1835016-pool --table '0 515883008 thin-pool 252:0 252:1 128 32768 1 skip_block_zeroing' \ + && sudo dmsetup resume docker-253:17-1835016-pool + ``` ## Device Mapper and Docker performance diff --git a/engine/userguide/storagedriver/imagesandcontainers.md b/engine/userguide/storagedriver/imagesandcontainers.md index 0fdf5df4ccb..69d7536cf60 100644 --- a/engine/userguide/storagedriver/imagesandcontainers.md +++ b/engine/userguide/storagedriver/imagesandcontainers.md @@ -1,13 +1,14 @@ ---- -description: Learn the technologies that support storage drivers. -keywords: -- container, storage, driver, AUFS, btfs, devicemapper,zvfs -menu: - main: - parent: engine_driver - weight: -2 -title: Understand images, containers, and storage drivers ---- + + # Understand images, containers, and storage drivers @@ -501,7 +502,7 @@ a container is deleted, any data stored in data volumes persists on the Docker host. For detailed information about data volumes -[Managing data in containers](https://docs.docker.com/engine/tutorials/dockervolumes/). +[Managing data in containers](https://docs.docker.com/userguide/dockervolumes/). ## Related information diff --git a/engine/userguide/storagedriver/index.md b/engine/userguide/storagedriver/index.md index 7384334e9ed..60d1255d77a 100644 --- a/engine/userguide/storagedriver/index.md +++ b/engine/userguide/storagedriver/index.md @@ -1,14 +1,15 @@ ---- -description: Learn how select the proper storage driver for your container. -keywords: -- container, storage, driver, AUFS, btfs, devicemapper,zvfs -menu: - main: - identifier: engine_driver - parent: engine_guide - weight: 7 -title: Docker storage drivers ---- + + # Docker storage drivers diff --git a/engine/userguide/storagedriver/overlayfs-driver.md b/engine/userguide/storagedriver/overlayfs-driver.md index caccf549ea5..b8c6d0dcd22 100644 --- a/engine/userguide/storagedriver/overlayfs-driver.md +++ b/engine/userguide/storagedriver/overlayfs-driver.md @@ -1,12 +1,12 @@ ---- -description: Learn how to optimize your use of OverlayFS driver. -keywords: -- 'container, storage, driver, OverlayFS ' -menu: - main: - parent: engine_driver -title: OverlayFS storage in practice ---- + # Docker and OverlayFS in practice diff --git a/engine/userguide/storagedriver/selectadriver.md b/engine/userguide/storagedriver/selectadriver.md index a766f547086..0677f5d7a2a 100644 --- a/engine/userguide/storagedriver/selectadriver.md +++ b/engine/userguide/storagedriver/selectadriver.md @@ -1,13 +1,13 @@ ---- -description: Learn how select the proper storage driver for your container. -keywords: -- container, storage, driver, AUFS, btfs, devicemapper,zvfs -menu: - main: - parent: engine_driver - weight: -1 -title: Select a storage driver ---- + # Select a storage driver diff --git a/engine/userguide/storagedriver/zfs-driver.md b/engine/userguide/storagedriver/zfs-driver.md index d17a55dc58f..e5b6dbcd8ec 100644 --- a/engine/userguide/storagedriver/zfs-driver.md +++ b/engine/userguide/storagedriver/zfs-driver.md @@ -1,12 +1,12 @@ ---- -description: Learn how to optimize your use of ZFS driver. -keywords: -- 'container, storage, driver, ZFS ' -menu: - main: - parent: engine_driver -title: ZFS storage in practice ---- + # Docker and ZFS in practice