Okty-io / okty

The simplest application to create and customize your docker projects
https://okty.io/
GNU General Public License v3.0
47 stars 10 forks source link

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

Open Diwoka opened 6 years ago

Diwoka commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

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

cgrandval commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

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

cgrandval commented 6 years ago

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

wsilva commented 6 years ago

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. =)