{"id":13552422,"url":"https://github.com/CenturyLinkLabs/docker-image-graph","last_synced_at":"2025-04-03T03:31:41.177Z","repository":{"id":19381116,"uuid":"22621949","full_name":"CenturyLinkLabs/docker-image-graph","owner":"CenturyLinkLabs","description":null,"archived":false,"fork":false,"pushed_at":"2020-01-24T17:31:43.000Z","size":862,"stargazers_count":113,"open_issues_count":5,"forks_count":27,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-03-22T06:12:07.482Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CenturyLinkLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-08-04T22:20:00.000Z","updated_at":"2024-11-28T16:29:48.000Z","dependencies_parsed_at":"2022-08-05T04:00:50.585Z","dependency_job_id":null,"html_url":"https://github.com/CenturyLinkLabs/docker-image-graph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenturyLinkLabs%2Fdocker-image-graph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenturyLinkLabs%2Fdocker-image-graph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenturyLinkLabs%2Fdocker-image-graph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CenturyLinkLabs%2Fdocker-image-graph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CenturyLinkLabs","download_url":"https://codeload.github.com/CenturyLinkLabs/docker-image-graph/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246933434,"owners_count":20857048,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T12:02:03.747Z","updated_at":"2025-04-03T03:31:36.070Z","avatar_url":"https://github.com/CenturyLinkLabs.png","language":"HTML","readme":"[![Analytics](https://ga-beacon.appspot.com/UA-49491413-7/docker-image-graph/README?pixel)](https://github.com/CenturyLinkLabs/docker-image-graph)\n[![](https://badge.imagelayers.io/centurylink/image-graph.svg)](https://imagelayers.io/?images=centurylink/image-graph:latest 'Get your own badge on imagelayers.io')\n\n\n## NOTE\n\nThis repo is no longer being maintained. Users are welcome to fork it, but we make no warranty of its functionality.\n\n## image-graph\nGenerates a nice graph showing the hierarchy of Docker images in your local\nimage cache.\n\nLooks at all of the Docker image layers cached on the local system and\ngenerates a PNG image showing the relationship of the various layers.\n\n### Usage\n\nThe Ruby *image-graph* script is itself packaged as a Docker image so it can\neasily be executed with the Docker *run* command.\n\nSince the script interacts with the Docker API in order to inspect your local\nimage cache it needs access to the Docker API socket. When starting the container, the `-v` flag needs to be used to make the Docker socket available inside the container.\n\nBy default, when the container is started it will generate a PNG that is streamed to `stdout`:\n\n    docker run --rm -v /var/run/docker.sock:/var/run/docker.sock \\\n      centurylink/image-graph \u003e docker_images.png\n\nYou'll need to redirect the container's output to a file in order to save/view the generated image. The name of the output file does not matter, but it is recommended that you use a `.png` extension so that your image viewer will properly recognize the format of the file.\n\nIf you supply an environment variabled named *PORT* using the `-e` flag the container will spin-up a web server on the designated port that hosts a web-based version of the image graph:\n\n    docker run -d -v /var/run/docker.sock:/var/run/docker.sock \\\n      -e PORT=3000 -p 3000:3000 centurylink/image-graph \n      \nIn the example above, the web server will be started on port 3000. When using this option you'll also want to use the `-p` flag to map the container port to a port on the host so that you can access the server from outside the container. The container port you specify with the `-p` flag should match the value you specified for the *PORT* environment variable.\n\nWhen a value for the *PORT* envrionment variable is provided, the PNG version of the image is **not** streamed to `stdout`. \n\n### Example\n\nHere's an example graph generated by this utility:\n\n![Sample Image](https://github.com/CenturyLinkLabs/docker-image-graph/raw/master/sample-cmd.png)\n\nAnd the web-based graph:\n\n![Sample Image](https://github.com/CenturyLinkLabs/docker-image-graph/raw/master/sample-web.png)\n\n### FAQs\n\n**How is this different than running `docker images --viz | dot -Tpng`?**\n\nActually, it's not different at all. The Ruby script executed by the image\nessentially generates the same output that the `--viz` flag does and then pipes\nit to the Graphviz *dot* tool to generate the graph.\n\n**So, why do we need to execute a container when the same thing can be\nachieved with a one-line Docker command?**\n\nWhile this will work for some versions of Docker, the `--viz` flag has been\nmarked as deprecated and will likely be removed in some future release.\n\nAdditionally, my primary Docker environment is CoreOS which does not have\nGraphviz installed and provides no way for me to install it myself -- in\nan environment like this, the only option is to run Graphviz inside a\ncontainer.\n","funding_links":[],"categories":["HTML","others"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCenturyLinkLabs%2Fdocker-image-graph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCenturyLinkLabs%2Fdocker-image-graph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCenturyLinkLabs%2Fdocker-image-graph/lists"}