Skip to content

Conversation

@vdemeester
Copy link

As for top-level key, any 3rd-level key which starts with x- will be
ignored by compose. This allows for users to:

  • include additional metadata in their compose files
  • create YAML anchor objects that can be re-used in other parts of the config

This matches a similar feature in the swagger spec definition:
https://swagger.io/specification/#specificationExtensions

This means a composefile like the following is valid

verison: "3.7"
services:
  foo:
    image: foo/bar
    x-foo: bar
network:
  bar:
    x-bar: baz

It concerns services, volumes, networks, configs and secrets.

@shin- @thaJeztah is v2.4 already released ? if yes, I'll have to update the PR to add a new 2.5 version 👼 😅

Linked to docker/cli#1097.

cc @dnephin @shin- @thaJeztah

Signed-off-by: Vincent Demeester [email protected]

As for top-level key, any 3rd-level key which starts with `x-` will be
ignored by compose. This allows for users to:
* include additional metadata in their compose files
* create YAML anchor objects that can be re-used in other parts of the config

This matches a similar feature in the swagger spec definition:
https://swagger.io/specification/#specificationExtensions

This means a composefile like the following is valid

```
verison: "3.7"
services:
  foo:
    image: foo/bar
    x-foo: bar
network:
  bar:
    x-bar: baz
```

It concerns services, volumes, networks, configs and secrets.

Signed-off-by: Vincent Demeester <[email protected]>
@shin-
Copy link

shin- commented Jun 5, 2018

LGTM!

@shin- shin- merged commit 13d8cf4 into docker:master Jun 5, 2018
@thaJeztah
Copy link
Member

Thanks! May need docs changes as well

@vdemeester vdemeester deleted the x-objects branch June 5, 2018 16:42
@shin- shin- added this to the 1.22.0 milestone Jun 21, 2018
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