Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

properties are upside down 🕺in docker-compose.yml #129

Open
Diwoka opened this issue Jul 17, 2018 · 8 comments
Open

properties are upside down 🕺in docker-compose.yml #129

Diwoka opened this issue Jul 17, 2018 · 8 comments
Labels
wontfix This will not be worked on

Comments

@Diwoka
Copy link

Diwoka commented Jul 17, 2018

Is your feature request related to a problem? Please describe.
It's not really a problem as everything's working fine. But all the properties for the services are upside down 🕺

    php:
        volumes:
            - './:/usr/share/nginx/html'
        environment:
            - PHP_EXTENSIONS=opcache
        image: 'okty/php:7.1'

Describe the solution you'd like
You can generate them in the reverse order 🔙

    php:
        image: 'okty/php:7.1'
        environment:
            - PHP_EXTENSIONS=opcache
        volumes:
            - './:/usr/share/nginx/html'
@tdutrion
Copy link

Actually, Yaml does not enforce parameters order, therefore this configuration is totally valid. That's a shame docker-compose does not use xml configuration, at least configuration would be consistent!

Should you add an xml configuration and an xml to yaml transpiler to enable consistent configurations?

@cgrandval
Copy link

Right @tdutrion, Yaml doesn't enforce parameters order but it's basically a de facto standard now, or at least it helps with reading quickly when written in the opposite order

@fdespier
Copy link

fdespier commented Jul 17, 2018

@docker what do you think to get more format to handle services ?

@tdutrion xml looks so heavy but why not use json.

@cgrandval
Copy link

cgrandval commented Jul 17, 2018

Perhaps, we could create a @tdutrion’s special mode to export in XML or an easter egg for him?

What do you think about @docker and others?

@tdutrion
Copy link

JSON doesn't guarantee parameters order either unless you use jsonx from IBM. You could provide a JSON schema though, which would be more than nothing even though not a proper language construction...

@skrzypczyk
Copy link

@tdutrion XML format why not, with an XSD schema to validate the structure. @docker

@cgrandval
Copy link

@tdutrion, seems you have one another person to develop that new docker possibility and make a PR to the moby project :-). @skrzypczyk

@wsilva
Copy link

wsilva commented Jul 27, 2018

Guys, this yaml format is an inheritance from fig (http://www.fig.sh/) when Docker bought Orchard back in 2013 or 2014, I am not sure the year.

Back in those days there was a couple tools like azk (http://www.azk.io/) and crane (https://github.com/michaelsauter/crane) that had similar purposes. For azk we need to write a azk file in js format. For crane in other hand we could use json or yaml.

Yaml format become quite standard in this automated world for a bunch of reasons. I use to make a joke with some friends that devops is basic yaml through ssh.

My 2 cents, yaml and json are much more easy to read, to write and to understand, and the payload is way lighter comparing to xml.

If you want to check if yaml or json is valid (at least the syntax) I recommend using lint tools.

Backing to the issue, the order of the nodes in the same level does not matter.
=)

@saamuelantunes saamuelantunes added the wontfix This will not be worked on label Jan 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

7 participants