Create a dependency diagram of your docker images
“Be able to read blueprints, diagrams, floorplans, and other diagrams used in the construction process.” ~ Marilyn vos Savant
When creating docker containers, it is not uncommon to have several low-level “base” images, which higher-level images are built from.
It would be nice to see which images extend which. This project aims to do that.
There are two ways to create a diagram of which docker image extends which.
grep
Dockerfiles to find FROM
and --from
entriesWith the first method, the name of the repository is known, but not the name of the image. With the second method, the name of the image is known, but not the name of the repository.
Combining both methods yields a result in which both are available.
Download the BASH scripts in cli/
so they can run locally.
This can be done by cloning the repository, or by downloading the scripts individually.
Gathering the required data and creating the diagram, have been split into separate steps. The scripts in cli/
are meant to be run locally.
They gather the required data and output it as JSON files.
The web application in web/
is meant to be run in a browser and takes the JSON files as input.
In order to create a diagram, the following steps need to be taken:
docker-grep.sh
script to create a JSON file with the results of grep
ing all Dockerfile
s in a group of repositories.dockerhub-fetch.sh
script to create a JSON file with the results of querying the Docker Registry API.web/index.html
in a browser and input the two JSON files.Optionally, the JSON and diagram code can be manually edited to make corrections or add additional information.
Please report any issues or feedback by opening an issue or reaching out to @potherca in Twitter.
.
├── cli/ <- Scripts to run the application
├── docs/ <- Documentation
├── web/ <- Web application
└── README.md <- This file
This project is created by Potherca licensed under an MPL-2.0 License.