Implement 'labels' option

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
This commit is contained in:
Aanand Prasad 2015-03-19 16:10:27 -07:00
commit 2e6bc078fb
10 changed files with 136 additions and 7 deletions

View file

@ -321,8 +321,8 @@ expose:
- "5000"
```
In the case of `environment`, Compose "merges" entries together with
locally-defined values taking precedence:
In the case of `environment` and `labels`, Compose "merges" entries together
with locally-defined values taking precedence:
```yaml
# original service

View file

@ -10,7 +10,7 @@ Compose with a `curl` command.
### Install Docker
First, install Docker version 1.3 or greater:
First, install Docker version 1.6 or greater:
- [Instructions for Mac OS X](http://docs.docker.com/installation/mac/)
- [Instructions for Ubuntu](http://docs.docker.com/installation/ubuntulinux/)

View file

@ -253,6 +253,24 @@ environment variables (DEBUG) with a new value, and the other one
For more on `extends`, see the [tutorial](extends.md#example) and
[reference](extends.md#reference).
### labels
Add metadata to containers using [Docker labels](http://docs.docker.com/userguide/labels-custom-metadata/). You can use either an array or a dictionary.
It's recommended that you use reverse-DNS notation to prevent your labels from conflicting with those used by other software.
```
labels:
com.example.description: "Accounting webapp"
com.example.department: "Finance"
com.example.label-with-empty-value: ""
labels:
- "com.example.description=Accounting webapp"
- "com.example.department=Finance"
- "com.example.label-with-empty-value"
```
### net
Networking mode. Use the same values as the docker client `--net` parameter.