Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

user specified properties and/or where to store metadata (author, description) #2942

Closed
AvdN opened this issue Feb 17, 2016 · 3 comments
Closed

Comments

@AvdN
Copy link

AvdN commented Feb 17, 2016

With version 1 files I have two comments at the beginning of the docker-compose file:

# author: Anthon van der Neut <a.van.der.neut@ruamel.eu>
# description: mongo container

that I then extract in dc2service using ruamel.yaml and include this information into service file for Systemd/Upstart . Of course I could follow the YACF principle (Yet Another Configuration File) so often seen in python projects, but with 1.6.0 and the version 2.0 file format I could easily do:

version: '2'
user-data:
  author: Anthon van der Neut <a.van.der.neut@ruamel.eu>
  description: mongo container
services:
   .......

Unfortunately docker-compose complains about user-data being an unexpected additional property.

For the toplevel mapping in version 2, I propose we get one or more keys reserved for user specific data, with the only requirement being that the corresponding value is a valid YAML construct i.e. the whole file stays parsable YAML. This could be one key, with the recommendation that its corresponding value is a mapping (for flexibility), or alternatively docker-compose could ignore all toplevel keys that have a certain prefix ("user-data-")

Something similar is e.g. done in container file formats like TIFF to allow inclusion of additional (vendor specific) information. That key's name should of course be something that is certainly not going to be used in docker-compose, so "user-data", "non-dc-data".

The docker-compose developers could then always cherry-pick information, that they consider useful for other projects (hopefully like my author/description) and decide them to be inserted under some other property, or maybe even warrant their own toplevel property.

@dnephin
Copy link

dnephin commented Feb 18, 2016

I think this overlaps with #1655 and #2578

@emk
Copy link

emk commented Sep 18, 2016

This would be exceptionally useful for tools that work with docker-compose.yml files.

emk added a commit to faradayio/cage that referenced this issue Sep 26, 2016
We had some half-backed scheme to treat _consistent_ configuration of
services within a pod as potential configuration for the pod as a
whole.  This was a stupid idea, and it was my fault.  We're just giving
up and creating config files to hold everything we need, since
docker/compose#1655 and
docker/compose#2942 do not show evidence of
happening in the immediate future.
@dnephin
Copy link

dnephin commented Aug 17, 2017

I've closed some other issues as duplicates of this one.

I think we should allow x-* keys at the top level in the next version of the 2.x and 3.x schemas

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

No branches or pull requests

3 participants