Skip to content

Conversation

@aanand
Copy link

@aanand aanand commented Mar 19, 2015

labels:
  com.example.description: "Accounting webapp"
  com.example.department: "Finance"
labels:
  - "com.example.description=Accounting webapp"
  - "com.example.department=Finance"

This is WIP for two reasons:

  1. It tests against a development version of Docker which is just bundled in the repo. Not nice.
  2. It uses an unreleased docker-py implementation of labels (Labels docker-py#532).

@aanand aanand added this to the 1.2.0 milestone Mar 19, 2015
@aanand aanand assigned aanand and unassigned aanand Mar 19, 2015
@thaJeztah
Copy link
Member

I'm still in preference of the first notation (a dict). I realise an array more closely matches the way ENV-vars are currently implemented, but a dict makes it more verbose that label names (keys) are unique. In addition, I can imagine a dict will be easier to handle, e.g., when merging labels from various sources (yaml, CLI, label-file), but that's a lesser concern.

@aanand
Copy link
Author

aanand commented Mar 20, 2015

@thaJeztah I also prefer the dict form, and I feel the same way about environment variables too - but for consistency between the two features, and between Compose and the Docker CLI, I think it's important to support both.

Both env vars and labels are normalised to a dictionary when we read them, so it's purely cosmetic.

@thaJeztah
Copy link
Member

@aanand no problem! Just emphasising the "dict" approach in the documentation should do :)

@dnephin
Copy link

dnephin commented Mar 20, 2015

I like it

Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
Signed-off-by: Aanand Prasad <aanand.prasad@gmail.com>
aanand added a commit that referenced this pull request Mar 21, 2015
WIP: `labels` option in docker-compose.yml
@aanand aanand merged commit 43eae73 into docker:master Mar 21, 2015
@aanand aanand deleted the labels branch March 21, 2015 00:04
@aanand aanand restored the labels branch March 21, 2015 00:15
@aanand
Copy link
Author

aanand commented Mar 21, 2015

I've force-unmerged this, since the docker binary is kind of big and we don't want to make everyone who clones docker/compose download it. Will re-merge it once #1144 is addressed.

@aanand aanand mentioned this pull request Mar 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants