mirror of https://github.com/docker/docs.git
Merge pull request #1917 from friism/patch-1
avoid syntax highlighter confusion
This commit is contained in:
commit
f6131d0331
|
@ -36,7 +36,7 @@ When you start a Swarm manager with the `swarm manage` command, all the filters
|
||||||
are enabled. If you want to limit the filters available to your Swarm, specify a subset
|
are enabled. If you want to limit the filters available to your Swarm, specify a subset
|
||||||
of filters by passing the `--filter` flag and the name:
|
of filters by passing the `--filter` flag and the name:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ swarm manage --filter=health --filter=dependency
|
$ swarm manage --filter=health --filter=dependency
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ host. Currently, the default tags include:
|
||||||
|
|
||||||
Custom node labels you apply when you start the `docker daemon`, for example:
|
Custom node labels you apply when you start the `docker daemon`, for example:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
$ docker daemon --label com.example.environment="production" --label
|
$ docker daemon --label com.example.environment="production" --label
|
||||||
com.example.storage="ssd"
|
com.example.storage="ssd"
|
||||||
```
|
```
|
||||||
|
@ -86,13 +86,17 @@ To specify custom label for a node, pass a list of `--label`
|
||||||
options at `docker` startup time. For instance, to start `node-1` with the
|
options at `docker` startup time. For instance, to start `node-1` with the
|
||||||
`storage=ssd` label:
|
`storage=ssd` label:
|
||||||
|
|
||||||
$ docker daemon --label storage=ssd
|
```bash
|
||||||
$ swarm join --advertise=192.168.0.42:2375 token://XXXXXXXXXXXXXXXXXX
|
$ docker daemon --label storage=ssd
|
||||||
|
$ swarm join --advertise=192.168.0.42:2375 token://XXXXXXXXXXXXXXXXXX
|
||||||
|
```
|
||||||
|
|
||||||
You might start a different `node-2` with `storage=disk`:
|
You might start a different `node-2` with `storage=disk`:
|
||||||
|
|
||||||
$ docker daemon --label storage=disk
|
```bash
|
||||||
$ swarm join --advertise=192.168.0.43:2375 token://XXXXXXXXXXXXXXXXXX
|
$ docker daemon --label storage=disk
|
||||||
|
$ swarm join --advertise=192.168.0.43:2375 token://XXXXXXXXXXXXXXXXXX
|
||||||
|
```
|
||||||
|
|
||||||
Once the nodes are joined to a cluster, the Swarm master pulls their respective
|
Once the nodes are joined to a cluster, the Swarm master pulls their respective
|
||||||
tags. Moving forward, the master takes the tags into account when scheduling
|
tags. Moving forward, the master takes the tags into account when scheduling
|
||||||
|
@ -133,35 +137,37 @@ The scheduler selected `node-2` since it was started with the `storage=disk` lab
|
||||||
Finally, build args can be used to apply node constraints to a `docker build`.
|
Finally, build args can be used to apply node constraints to a `docker build`.
|
||||||
Again, you'll avoid flash drives.
|
Again, you'll avoid flash drives.
|
||||||
|
|
||||||
$ mkdir sinatra
|
```bash
|
||||||
$ cd sinatra
|
$ mkdir sinatra
|
||||||
$ echo "FROM ubuntu:14.04" > Dockerfile
|
$ cd sinatra
|
||||||
$ echo "MAINTAINER Kate Smith <ksmith@example.com>" >> Dockerfile
|
$ echo "FROM ubuntu:14.04" > Dockerfile
|
||||||
$ echo "RUN apt-get update && apt-get install -y ruby ruby-dev" >> Dockerfile
|
$ echo "MAINTAINER Kate Smith <ksmith@example.com>" >> Dockerfile
|
||||||
$ echo "RUN gem install sinatra" >> Dockerfile
|
$ echo "RUN apt-get update && apt-get install -y ruby ruby-dev" >> Dockerfile
|
||||||
$ docker build --build-arg=constraint:storage==disk -t ouruser/sinatra:v2 .
|
$ echo "RUN gem install sinatra" >> Dockerfile
|
||||||
Sending build context to Docker daemon 2.048 kB
|
$ docker build --build-arg=constraint:storage==disk -t ouruser/sinatra:v2 .
|
||||||
Step 1 : FROM ubuntu:14.04
|
Sending build context to Docker daemon 2.048 kB
|
||||||
|
Step 1 : FROM ubuntu:14.04
|
||||||
---> a5a467fddcb8
|
---> a5a467fddcb8
|
||||||
Step 2 : MAINTAINER Kate Smith <ksmith@example.com>
|
Step 2 : MAINTAINER Kate Smith <ksmith@example.com>
|
||||||
---> Running in 49e97019dcb8
|
---> Running in 49e97019dcb8
|
||||||
---> de8670dcf80e
|
---> de8670dcf80e
|
||||||
Removing intermediate container 49e97019dcb8
|
Removing intermediate container 49e97019dcb8
|
||||||
Step 3 : RUN apt-get update && apt-get install -y ruby ruby-dev
|
Step 3 : RUN apt-get update && apt-get install -y ruby ruby-dev
|
||||||
---> Running in 26c9fbc55aeb
|
---> Running in 26c9fbc55aeb
|
||||||
---> 30681ef95fff
|
---> 30681ef95fff
|
||||||
Removing intermediate container 26c9fbc55aeb
|
Removing intermediate container 26c9fbc55aeb
|
||||||
Step 4 : RUN gem install sinatra
|
Step 4 : RUN gem install sinatra
|
||||||
---> Running in 68671d4a17b0
|
---> Running in 68671d4a17b0
|
||||||
---> cd70495a1514
|
---> cd70495a1514
|
||||||
Removing intermediate container 68671d4a17b0
|
Removing intermediate container 68671d4a17b0
|
||||||
Successfully built cd70495a1514
|
Successfully built cd70495a1514
|
||||||
|
|
||||||
$ docker images
|
$ docker images
|
||||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||||
dockerswarm/swarm master 8c2c56438951 2 days ago 795.7 MB
|
dockerswarm/swarm master 8c2c56438951 2 days ago 795.7 MB
|
||||||
ouruser/sinatra v2 cd70495a1514 35 seconds ago 318.7 MB
|
ouruser/sinatra v2 cd70495a1514 35 seconds ago 318.7 MB
|
||||||
ubuntu 14.04 a5a467fddcb8 11 days ago 187.9 MB
|
ubuntu 14.04 a5a467fddcb8 11 days ago 187.9 MB
|
||||||
|
```
|
||||||
|
|
||||||
### Use the health filter
|
### Use the health filter
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue