Compose: Add diagram generator feature

Created on 31 Mar 2016  路  4Comments  路  Source: docker/compose

Related to https://github.com/docker/compose/issues/788 & kind of https://github.com/docker/compose/issues/1341

There's kind of many tools able to generate diagrams from docker compose yml config files:

| url | language | v2 format support |
| --- | --- | --- |
| https://github.com/dockerboard/marsoon | js | no |
| https://github.com/digibib/docker-compose-dot | go | partial |
| https://github.com/abesto/docker-compose-graphviz | go | no |
| http://dockercompose.inventage.com | ? | no |
| https://github.com/rabelenda/docker2plant | groovy | no |
| https://github.com/Alexis-benoist/draw-compose | python | no |

But, of course, here's the conclusion when testing them:

  • They don't reuse the official docker-compose config parser.
  • They're all incomplete, so 6 incomplete products instead of 1 complete one, there's a way to group the development effort.
  • They don't have guidelines for the rendered output, each of them have some nice ideas but would be cool to put all the ideas together to make something great.
  • Docker don't support them in any way.

So, docker guys, should be great to help this kind of tool emerging the right way no?

1st, maybe the config parser for docker compose could be available a separate lib? Or docker-compose could provide some plugins interface?
It would be also very pleasant at the end to provide a gorgeous docker color palette by default for the generated diagram that could make them like beautiful, consistent / pro diagrams.

kinfeature

Most helpful comment

@shin- Can you clarify why you think this doesn't serve a practical purpose? Having a programmatically generated diagram of your services that stays up to date automatically seems like a pretty awesome way to document your architecture. It may not give you a ton of information, but if you have a whole bunch of services that are constantly evolving, an automatically generated diagram that you could rely on would be a pretty useful tool.

All 4 comments

This one is working with v2 and v3 format but need to be launch with root option :
https://github.com/pmsipilot/docker-compose-viz

docker run --rm \
        -it \
        -v $(pwd):/input/ \
        -u 0 \
        pmsipilot/docker-compose-viz \
        render -m image

Probably not something we'll do at this point. While it's a "fun" feature, it rarely serves any practical purpose, and it's not essential to the user experience.

@shin- Can you clarify why you think this doesn't serve a practical purpose? Having a programmatically generated diagram of your services that stays up to date automatically seems like a pretty awesome way to document your architecture. It may not give you a ton of information, but if you have a whole bunch of services that are constantly evolving, an automatically generated diagram that you could rely on would be a pretty useful tool.

Agreed with @Didericis . It could also help you to "debug" when using multiple networks on multiple docker-compose projects to see how docker is interpreting it.

Was this page helpful?
0 / 5 - 0 ratings