No description
Find a file
2018-08-31 05:16:34 +02:00
.gitignore Add command line parameters 2018-08-31 04:53:54 +02:00
docker-net-graph.py Add command line parameters 2018-08-31 04:53:54 +02:00
Dockerfile Add Dockerfile and instructions for running container 2018-08-31 05:16:34 +02:00
Pipfile Add command line parameters 2018-08-31 04:53:54 +02:00
Pipfile.lock Add command line parameters 2018-08-31 04:53:54 +02:00
README.md Add Dockerfile and instructions for running container 2018-08-31 05:16:34 +02:00
requirements-dev.txt Initial commit 2016-09-30 00:48:22 +03:00

Docker Network Graph

Sample python script to draw graph of Docker networks and containers

Usage

usage: docker-net-graph.py [-h] [-v] [-o OUT]

Generate docker network graph.

optional arguments:
  -h, --help         show this help message and exit
  -v, --verbose      Verbose output
  -o OUT, --out OUT  Write output to file

In most cases what you want to run are the following couple commands:

git clone https://github.com/LeoVerto/docker-network-graph-poc.git
cd docker-network-graph-poc
pipenv install
pipenv run python docker-net-graph.py -o output.gv

This will end up generating a .pdf file containing the graph.

Running inside docker

If you want to generate a graph for a remote system you can also easily run this script inside a pre-built docker container:

docker run -v /var/run/docker.sock:/var/run/docker.sock leoverto/docker-net-graph

This will just generate and output the graph. You can then run dot -Tpdf -o out.pdfor dot -Tpng -o out.png on a system with graphviz installed, paste the previous output there, press enter and finally CTRL+C to generate the file.