'Display final docker compose

When using multiple docker compose files, they will be merged into a final compose final before it will be used.

Is there any way of displaying this "final" compose file, to see how the different compose files are put together? I am looking for a dump command, instead of the usual up, stop, ... commands, but I do not find that in the documentation.

Is there any workaround for achieving the same result?



Solution 1:[1]

The command you are looking for is docker-compose config. Pass the same parameters you would to up/stop/etc to parse multiple files, and it will output the parsed and merged yaml with variables expanded.

See the docs for more details: https://docs.docker.com/compose/reference/config/

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 BMitch