From 243fcad43ff42e27beb66140346cf722a8584206 Mon Sep 17 00:00:00 2001 From: Will Date: Fri, 16 Jun 2023 21:06:24 -0400 Subject: [PATCH] utilities build, run, and consistent name scheme --- Dockerfile | 4 ++-- LICENSE | 3 ++- README.md | 10 +++++----- docker-net-graph.py => docker-network-graph.py | 0 tool/build | 6 ++++++ tool/run | 6 ++++++ 6 files changed, 21 insertions(+), 8 deletions(-) rename docker-net-graph.py => docker-network-graph.py (100%) create mode 100755 tool/build create mode 100755 tool/run diff --git a/Dockerfile b/Dockerfile index e8e0de6..28d8651 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,6 +7,6 @@ COPY Pipfile Pipfile.lock ./ RUN pip install pipenv RUN pipenv install --system --deploy -COPY docker-net-graph.py ./ +COPY docker-network-graph.py ./ -ENTRYPOINT ["python", "docker-net-graph.py"] \ No newline at end of file +ENTRYPOINT ["python", "docker-network-graph.py"] diff --git a/LICENSE b/LICENSE index d114162..686f034 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,5 @@ Copyright (c) 2018 Eugene Agafonov +Copyright (c) 2023 e-dant (github.com/e-dant) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -16,4 +17,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. \ No newline at end of file +SOFTWARE. diff --git a/README.md b/README.md index e64b817..3e6a036 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,10 @@ as a neat graphviz graph. ## Example -![example graph](https://raw.githubusercontent.com/LeoVerto/docker-network-graph/master/example.png) +![example graph](https://raw.githubusercontent.com/e-dant/docker-network-graph/release/example.png) ## Usage - usage: docker-net-graph.py [-h] [-v] [-o OUT] + usage: docker-network-graph.py [-h] [-v] [-o OUT] Visualize docker networks. @@ -19,10 +19,10 @@ as a neat graphviz graph. In most cases what you want to run are the following couple commands: - git clone https://github.com/LeoVerto/docker-network-graph.git + git clone https://github.com/e-dant/docker-network-graph.git cd docker-network-graph pipenv install - pipenv run python docker-net-graph.py -o output.svg + pipenv run python docker-network-graph.py -o output.svg This will generate an .svg file containing the graph. @@ -30,7 +30,7 @@ This will generate an .svg file containing the graph. 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 --rm -v /var/run/docker.sock:/var/run/docker.sock leoverto/docker-network-graph + docker run --rm -v /var/run/docker.sock:/var/run/docker.sock e-dant/docker-network-graph This will just generate and output the graph in the [DOT Language][dot]. You can then paste that code into [GraphvizOnline][gvonline] diff --git a/docker-net-graph.py b/docker-network-graph.py similarity index 100% rename from docker-net-graph.py rename to docker-network-graph.py diff --git a/tool/build b/tool/build new file mode 100755 index 0000000..631dd8f --- /dev/null +++ b/tool/build @@ -0,0 +1,6 @@ +#! /usr/bin/env bash + +( + cd "$(dirname "$0")/.." \ + && pipenv install +) diff --git a/tool/run b/tool/run new file mode 100755 index 0000000..b1af30f --- /dev/null +++ b/tool/run @@ -0,0 +1,6 @@ +#! /usr/bin/env bash + +( + cd "$(dirname "$0")/.." \ + && pipenv run python docker-network-graph.py -o output.svg +)