1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Escape some double brackets

Signed-off-by: Misty Stanley-Jones <misty@docker.com>
This commit is contained in:
Misty Stanley-Jones 2017-04-04 10:06:32 -07:00
parent f6b7dc9837
commit 622bdadfd7

View file

@ -17,15 +17,15 @@ title: Plugins and Services
In swarm mode, it is possible to create a service that allows for attaching In swarm mode, it is possible to create a service that allows for attaching
to networks or mounting volumes that are backed by plugins. Swarm schedules to networks or mounting volumes that are backed by plugins. Swarm schedules
services based on plugin availability on a node. services based on plugin availability on a node.
### Volume plugins ### Volume plugins
In this example, a volume plugin is installed on a swarm worker and a volume In this example, a volume plugin is installed on a swarm worker and a volume
is created using the plugin. In the manager, a service is created with the is created using the plugin. In the manager, a service is created with the
relevant mount options. It can be observed that the service is scheduled to relevant mount options. It can be observed that the service is scheduled to
run on the worker node with the said volume plugin and volume. Note that, run on the worker node with the said volume plugin and volume. Note that,
node1 is the manager and node2 is the worker. node1 is the manager and node2 is the worker.
1. Prepare manager. In node 1: 1. Prepare manager. In node 1:
@ -51,7 +51,7 @@ node1 is the manager and node2 is the worker.
Status: Downloaded newer image for tiborvass/sample-volume-plugin:latest Status: Downloaded newer image for tiborvass/sample-volume-plugin:latest
Installed plugin tiborvass/sample-volume-plugin Installed plugin tiborvass/sample-volume-plugin
``` ```
```bash ```bash
$ docker volume create -d tiborvass/sample-volume-plugin --name pluginVol $ docker volume create -d tiborvass/sample-volume-plugin --name pluginVol
``` ```
@ -62,28 +62,30 @@ node1 is the manager and node2 is the worker.
$ docker service create --name my-service --mount type=volume,volume-driver=tiborvass/sample-volume-plugin,source=pluginVol,destination=/tmp busybox top $ docker service create --name my-service --mount type=volume,volume-driver=tiborvass/sample-volume-plugin,source=pluginVol,destination=/tmp busybox top
$ docker service ls $ docker service ls
z1sj8bb8jnfn my-service replicated 1/1 busybox:latest z1sj8bb8jnfn my-service replicated 1/1 busybox:latest
``` ```
docker service ls shows service 1 instance of service running. docker service ls shows service 1 instance of service running.
4. Observe the task getting scheduled in node 2: 4. Observe the task getting scheduled in node 2:
```bash ```bash
{% raw %}
$ docker ps --format '{{.ID}}\t {{.Status}} {{.Names}} {{.Command}}' $ docker ps --format '{{.ID}}\t {{.Status}} {{.Names}} {{.Command}}'
83fc1e842599 Up 2 days my-service.1.9jn59qzn7nbc3m0zt1hij12xs "top" 83fc1e842599 Up 2 days my-service.1.9jn59qzn7nbc3m0zt1hij12xs "top"
{% endraw %}
``` ```
### Network plugins ### Network plugins
In this example, a global scope network plugin is installed on both the In this example, a global scope network plugin is installed on both the
swarm manager and worker. A service is created with replicated instances swarm manager and worker. A service is created with replicated instances
using the installed plugin. We will observe how the availability of the using the installed plugin. We will observe how the availability of the
plugin determines network creation and container scheduling. plugin determines network creation and container scheduling.
Note that node1 is the manager and node2 is the worker. Note that node1 is the manager and node2 is the worker.
1. Install a global scoped network plugin on both manager and worker. On node1 1. Install a global scoped network plugin on both manager and worker. On node1
and node2: and node2:
```bash ```bash