Docker Compose Viz Docker Image
用于可视化Docker Compose配置文件的工具,可生成服务间关系图,直观展示链接、卷、依赖、端口和网络等组件关系,支持多种输出格式。
docker-compose-viz
How to use
docker run --rm -it --name dcv -v $(pwd):/input pmsipilot/docker-compose-viz
Usage
render [options] [--] [<input-file>] Arguments: input-file Path to a docker compose file [default: "./docker-compose.yml"] Options: -o, --output-file=OUTPUT-FILE Path to a output file (Only for "dot" and "image" output format) [default: "./docker-compose.dot" or "./docker-compose.png"] -m, --output-format=OUTPUT-FORMAT Output format (one of: "dot", "image", "display") [default: "display"] --only=ONLY Display a graph only for a given services (multiple values allowed) -f, --force Overwrites output file if it already exists --no-volumes Do not display volumes -r, --horizontal Display a horizontal graph
How to read the graph
Links
Links (from services.<service>.links) are displayed as plain arrows pointing to the service that declares the link:
If we look at the link between mysql and ambassador, it reads as follow: "mysql is known as mysql in ambassador."
If we look at the link between ambassador and logs, it reads as follow: "ambassador is known as logstash in logs."
External links are displayed using the same shapes but are grayed:
Volumes
Volumes (from services.<service>.volumes_from) are displayed as dashed arrows pointing to the service that uses the volumes:
If we look at the link between logs and api, it reads as follow: "api uses volumes from logs."
Volumes (from services.<service>.volumes) are displayed as folders with the host directory as label and are linked to the service that uses them dashed arrows.
If we look at the link between ./api and api, it reads as follow: "the host directory ./apiis mounted as a read-write folder on /src in api." Bidirectional arrows mean the directory is writable from the container.
If we look at the link between ./etc/api/php-fpm.d and api, it reads as follow: "the host directory ./etc/api/php-fpm.dis mounted as a read-only folder on /usr/local/etc/php-fpm.d in api." Unidirectional arrows mean the directory is not writable from the container.
Dependencies
Dependencies (from services.<service>.depends_on) are displayed as dotted arrows pointing to the service that declares the dependencies:
If we look at the link between mysql and logs, it reads as follow: "mysql depends on logs."
Ports
Ports (from services.<service>.ports) are displayed as circle and are linked to containers using plain arrows pointing to the service that declares the ports:
If we look at the link between port 2480 and orientdb, it reads as follow: "traffic coming to host port 2480 will be routed to port 2480 of orientdb."
If we look at the link between port 2580 and elk, it reads as follow: "traffix coming to host port 2580 will be routed to port 80 of elk."
Extends
Extended services (from services.<service>.extends) are displayed as components (just like normal services). The links between them and the extending services are
displayed as inverted arrows:
If we look at the link between mysql and db, it reads as follow: "mysql extends service db".
Networks
Networks (from networks.<network>) are displayed as pentagon. The links between them and services are displayed as plain arrows pointing to the network:
If we look at the link between mysql and the global network, it reads as follow: "mysql is known as mysql, db and reldb in the global network.
The legacy network is an external so it's displayed as a grayed pentagone.
Examples
dot renderer
dotdigraph G { graph [pad=0.5] "front" [shape="component"] "http" [shape="component"] 2380 [shape="circle"] "ambassador" [shape="component"] "mysql" [shape="component"] "orientdb" [shape="component"] "elk" [shape="component"] "api" [shape="component"] "piwik" [shape="component"] "logs" [shape="component"] "html" [shape="component"] 2580 [shape="circle"] 2480 [shape="circle"] "http" -> "front" [style="solid"] 2380 -> "front" [style="solid" label=80] "mysql" -> "ambassador" [style="solid"] "orientdb" -> "ambassador" [style="solid"] "elk" -> "ambassador" [style="solid"] "api" -> "http" [style="solid"] "piwik" -> "http" [style="solid"] "logs" -> "http" [style="dashed"] "piwik" -> "http" [style="dashed"] "html" -> "http" [style="dashed"] "ambassador" -> "api" [style="solid" label="graphdb"] "ambassador" -> "api" [style="solid" label="reldb"] "logs" -> "api" [style="dashed"] "ambassador" -> "logs" [style="solid" label="logstash"] 2580 -> "elk" [style="solid" label=80] "ambassador" -> "piwik" [style="solid" label="db"] 2480 -> "orientdb" [style="solid"] }
image renderer
display renderer
License
The MIT License (MIT) Copyright (c) 2016 PMSIpilot
镜像拉取方式
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
轩辕镜像加速拉取命令点我查看更多 docker-compose-viz 镜像标签
DockerHub 原生拉取命令
用户好评
来自真实用户的反馈,见证轩辕镜像的优质服务