mirror of https://github.com/docker/docs.git
Fix rendering of code block for swarm tutorial (#1370)
Indentations are added to fix rendering failure.
This commit is contained in:
parent
3ff3b7cf42
commit
49a333885d
|
@ -8,10 +8,11 @@ Once you've [created a swarm](create-swarm.md) with a manager node, you're ready
|
|||
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`.
|
||||
This tutorial uses the name `worker1`.
|
||||
|
||||
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:
|
||||
[Create a swarm](create-swarm.md) tutorial step to create a worker node
|
||||
joined to the existing swarm:
|
||||
|
||||
```bash
|
||||
$ docker swarm join \
|
||||
|
@ -35,11 +36,11 @@ 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`.
|
||||
worker node. This tutorial uses the name `worker2`.
|
||||
|
||||
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:
|
||||
[Create a swarm](create-swarm.md) tutorial step to create a second worker
|
||||
node joined to the existing swarm:
|
||||
|
||||
```bash
|
||||
$ docker swarm join \
|
||||
|
@ -49,8 +50,8 @@ 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
|
||||
the `docker node ls` command to see the worker nodes:
|
||||
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
|
||||
ID HOSTNAME STATUS AVAILABILITY MANAGER STATUS
|
||||
|
|
|
@ -8,21 +8,22 @@ The remaining steps in the tutorial don't use the `helloworld` service, so now
|
|||
you can delete the service from the swarm.
|
||||
|
||||
1. If you haven't already, open a terminal and ssh into the machine where you
|
||||
run your manager node. For example, the tutorial uses a machine named
|
||||
`manager1`.
|
||||
run your manager node. For example, the tutorial uses a machine named
|
||||
`manager1`.
|
||||
|
||||
2. Run `docker service rm helloworld` to remove the `helloworld` service.
|
||||
|
||||
```
|
||||
```bash
|
||||
$ docker service rm helloworld
|
||||
|
||||
helloworld
|
||||
```
|
||||
|
||||
3. Run `docker service inspect <SERVICE-ID>` to verify that the swarm manager
|
||||
removed the service. The CLI returns a message that the service is not found:
|
||||
removed the service. The CLI returns a message that the service is not
|
||||
found:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ docker service inspect helloworld
|
||||
[]
|
||||
Error: no such service: helloworld
|
||||
|
|
|
@ -8,8 +8,8 @@ After you [create a swarm](create-swarm.md), you can deploy a service to the
|
|||
swarm. For this tutorial, you also [added worker nodes](add-nodes.md), but that
|
||||
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`.
|
||||
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 following command:
|
||||
|
||||
|
@ -27,7 +27,7 @@ example, the tutorial uses a machine named `manager1`.
|
|||
|
||||
3. Run `docker service ls` to see the list of running services:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ docker service ls
|
||||
|
||||
ID NAME SCALE IMAGE COMMAND
|
||||
|
|
|
@ -14,8 +14,8 @@ from the swarm manager. It also means the manager stops tasks running on the
|
|||
node and launches replica tasks on a node with `ACTIVE` availability.
|
||||
|
||||
1. If you haven't already, open a terminal and ssh into the machine where you
|
||||
run your manager node. For example, the tutorial uses a machine named
|
||||
`manager1`.
|
||||
run your manager node. For example, the tutorial uses a machine named
|
||||
`manager1`.
|
||||
|
||||
2. Verify that all your nodes are actively available.
|
||||
|
||||
|
|
|
@ -8,15 +8,15 @@ When you have [deployed a service](deploy-service.md) to your swarm, you can use
|
|||
the Docker CLI to see details about the service running in the swarm.
|
||||
|
||||
1. If you haven't already, open a terminal and ssh into the machine where you
|
||||
run your manager node. For example, the tutorial uses a machine named
|
||||
`manager1`.
|
||||
run your manager node. For example, the tutorial uses a machine named
|
||||
`manager1`.
|
||||
|
||||
2. Run `docker service inspect --pretty <SERVICE-ID>` to display the details
|
||||
about a service in an easily readable format.
|
||||
about a service in an easily readable format.
|
||||
|
||||
To see the details on the `helloworld` service:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ docker service inspect --pretty helloworld
|
||||
|
||||
ID: 9uk4639qpg7npwf3fn2aasksr
|
||||
|
@ -36,7 +36,7 @@ about a service in an easily readable format.
|
|||
>**Tip**: To return the service details in json format, run the same command
|
||||
without the `--pretty` flag.
|
||||
|
||||
```
|
||||
```bash
|
||||
$ docker service inspect helloworld
|
||||
[
|
||||
{
|
||||
|
@ -86,9 +86,9 @@ about a service in an easily readable format.
|
|||
```
|
||||
|
||||
4. Run `docker service ps <SERVICE-ID>` to see which nodes are running the
|
||||
service:
|
||||
service:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ docker service ps helloworld
|
||||
|
||||
NAME IMAGE NODE DESIRED STATE LAST STATE
|
||||
|
@ -104,7 +104,7 @@ service:
|
|||
definition.
|
||||
|
||||
4. Run `docker ps` on the node where the task is running to see details about
|
||||
the container for the task.
|
||||
the container for the task.
|
||||
|
||||
>**Tip**: If `helloworld` is running on a node other than your manager node,
|
||||
you must ssh to that node.
|
||||
|
|
|
@ -10,11 +10,11 @@ on the Redis 3.0.6 container image. Then you upgrade the service to use the
|
|||
Redis 3.0.7 container image using rolling updates.
|
||||
|
||||
1. If you haven't already, open a terminal and ssh into the machine where you
|
||||
run your manager node. For example, the tutorial uses a machine named
|
||||
`manager1`.
|
||||
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
|
||||
update delay:
|
||||
update delay:
|
||||
|
||||
```bash
|
||||
$ docker service create \
|
||||
|
|
|
@ -9,11 +9,11 @@ to use the Docker CLI to scale the number of service ps in
|
|||
the swarm.
|
||||
|
||||
1. If you haven't already, open a terminal and ssh into the machine where you
|
||||
run your manager node. For example, the tutorial uses a machine named
|
||||
`manager1`.
|
||||
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
|
||||
service running in the swarm:
|
||||
service running in the swarm:
|
||||
|
||||
```bash
|
||||
$ docker service scale <SERVICE-ID>=<NUMBER-OF-TASKS>
|
||||
|
@ -29,7 +29,7 @@ service running in the swarm:
|
|||
|
||||
3. Run `docker service ps <SERVICE-ID>` to see the updated task list:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ docker service ps helloworld
|
||||
|
||||
NAME IMAGE NODE DESIRED STATE CURRENT STATE
|
||||
|
@ -45,9 +45,9 @@ service running in the swarm:
|
|||
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
|
||||
connected. The following example shows the tasks running on `manager1`:
|
||||
connected. The following example shows the tasks running on `manager1`:
|
||||
|
||||
```
|
||||
```bash
|
||||
$ docker ps
|
||||
|
||||
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
|
||||
|
|
Loading…
Reference in New Issue