Select Git revision
-
David Beniamine authoredDavid Beniamine authored
Readme.md 1.37 KiB
A docker image to visualize docker-compose configs with mermaid.
Base on docker-compose-viz-mermaid and mermaid-cli
Examples
# Directly generate an image of with 1000px
docker run --rm -it -v $PWD:/data dbeniamine/docker-compose-viz-mermaid -M -otest.png -M -w1000
# Generate a svg with default parameters for mermaid and showing the ports
docker run --rm -it -v $PWD:/data dbeniamine/docker-compose-viz-mermaid -v -p -m
# Generates the markdown sources with a mermaid block showing ports
docker run --rm -it -v $PWD:/data dbeniamine/docker-compose-viz-mermaid -v -p -v -fMARKDOWN
Example image
Configuration
I recommand to use the dcviz
command to call docker-compose-viz-mermaid
, it parses a complex docker-compose
configuration with docker-compose config
before calling the visualization tool :
To add the dcviz
command, add the following code to your .bashrc
, note that you can change the default arguments to suit your needs
dcviz() {
docker-compose config > $$.yml
docker run --rm -it -v $PWD:/data dbeniamine/docker-compose-viz-mermaid -v --ports -v $$.yml $@
rm $$.yml > /dev/null 2>&1
}
Then you can simply run dcviz -M -omyimage.png
to generate the image or dcviz -v -fMARKDOWN
to get the markdown sources