{"id":13446752,"url":"https://github.com/patrickhoefler/dockerfilegraph","last_synced_at":"2025-10-21T03:59:01.954Z","repository":{"id":37847356,"uuid":"340634070","full_name":"patrickhoefler/dockerfilegraph","owner":"patrickhoefler","description":"Visualize your multi-stage Dockerfiles","archived":false,"fork":false,"pushed_at":"2025-10-18T03:46:38.000Z","size":1427,"stargazers_count":237,"open_issues_count":3,"forks_count":16,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-18T16:09:52.994Z","etag":null,"topics":["cli","command-line","container","docker","dockerfile","go","golang","graph","graphviz","visualization"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrickhoefler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-02-20T11:07:15.000Z","updated_at":"2025-10-17T18:09:11.000Z","dependencies_parsed_at":"2023-11-14T17:32:15.603Z","dependency_job_id":"bf443554-c7e1-4a62-9079-aa20fa0fad93","html_url":"https://github.com/patrickhoefler/dockerfilegraph","commit_stats":null,"previous_names":[],"tags_count":51,"template":false,"template_full_name":null,"purl":"pkg:github/patrickhoefler/dockerfilegraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhoefler%2Fdockerfilegraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhoefler%2Fdockerfilegraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhoefler%2Fdockerfilegraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhoefler%2Fdockerfilegraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrickhoefler","download_url":"https://codeload.github.com/patrickhoefler/dockerfilegraph/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrickhoefler%2Fdockerfilegraph/sbom","scorecard":{"id":379819,"data":{"date":"2025-08-11","repo":{"name":"github.com/patrickhoefler/dockerfilegraph","commit":"aa924e341c81e07facb732fabb560574aa8c0848"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":5.6,"checks":[{"name":"Maintained","score":10,"reason":"30 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'actions' permission set to 'read': .github/workflows/codeql.yml:31","Info: jobLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:32","Info: jobLevel 'contents' permission set to 'read': .github/workflows/lint_and_test.yml:12","Info: jobLevel 'pull-requests' permission set to 'read': .github/workflows/lint_and_test.yml:13","Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Info: topLevel 'contents' permission set to 'read': .github/workflows/codeql.yml:24","Info: topLevel 'contents' permission set to 'read': .github/workflows/lint_and_test.yml:7","Warn: no topLevel permission defined: .github/workflows/release.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.19.0 not signed: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/232057920","Warn: release artifact v0.18.0 not signed: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/220735573","Warn: release artifact v0.17.12 not signed: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/220689465","Warn: release artifact v0.17.11 not signed: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/209165054","Warn: release artifact v0.17.10 not signed: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/190728691","Warn: release artifact v0.19.0 does not have provenance: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/232057920","Warn: release artifact v0.18.0 does not have provenance: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/220735573","Warn: release artifact v0.17.12 does not have provenance: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/220689465","Warn: release artifact v0.17.11 does not have provenance: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/209165054","Warn: release artifact v0.17.10 does not have provenance: https://api.github.com/repos/patrickhoefler/dockerfilegraph/releases/190728691"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/release.yml:12"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":6,"reason":"dependency not pinned by hash detected -- score normalized to 6","details":["Warn: containerImage not pinned by hash: examples/dockerfiles/Dockerfile.large:1","Warn: containerImage not pinned by hash: examples/dockerfiles/Dockerfile.large:3","Warn: containerImage not pinned by hash: examples/dockerfiles/Dockerfile.large:5","Warn: containerImage not pinned by hash: examples/dockerfiles/Dockerfile.large:11","Warn: containerImage not pinned by hash: examples/dockerfiles/Dockerfile.large:13","Warn: containerImage not pinned by hash: examples/dockerfiles/Dockerfile.large:36","Warn: containerImage not pinned by hash: examples/dockerfiles/Dockerfile.large:40","Warn: containerImage not pinned by hash: examples/dockerfiles/Dockerfile.large:46","Warn: goCommand not pinned by hash: .github/workflows/lint_and_test.yml:56","Info:  14 out of  14 GitHub-owned GitHubAction dependencies pinned","Info:  10 out of  10 third-party GitHubAction dependencies pinned","Info:   4 out of  12 containerImage dependencies pinned","Info:   0 out of   1 goCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":10,"reason":"SAST tool is run on all commits","details":["Info: SAST configuration detected: CodeQL","Info: all commits (30) are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-18T15:08:17.446Z","repository_id":37847356,"created_at":"2025-08-18T15:08:17.446Z","updated_at":"2025-08-18T15:08:17.446Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280200870,"owners_count":26289477,"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","status":"online","status_checked_at":"2025-10-21T02:00:06.614Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cli","command-line","container","docker","dockerfile","go","golang","graph","graphviz","visualization"],"created_at":"2024-07-31T05:00:58.814Z","updated_at":"2025-10-21T03:59:01.948Z","avatar_url":"https://github.com/patrickhoefler.png","language":"Go","funding_links":[],"categories":["Docker Images","User Interfaces","Go"],"sub_categories":["Dockerfile","Terminal"],"readme":"# dockerfilegraph\n\n[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/patrickhoefler/dockerfilegraph/ci.yml?branch=main)](https://github.com/patrickhoefler/dockerfilegraph/actions/workflows/ci.yml?query=branch%3Amain)\n[![Go Report Card](https://goreportcard.com/badge/github.com/patrickhoefler/dockerfilegraph)](https://goreportcard.com/report/github.com/patrickhoefler/dockerfilegraph)\n[![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/patrickhoefler/dockerfilegraph)](https://github.com/patrickhoefler/dockerfilegraph/releases/latest)\n[![GitHub](https://img.shields.io/github/license/patrickhoefler/dockerfilegraph)](https://github.com/patrickhoefler/dockerfilegraph/blob/main/LICENSE)\n\nA command-line tool that visualizes multi-stage Dockerfiles as dependency graphs.\n\nUses [Graphviz](https://graphviz.org/) to generate visual representations of Docker build processes, helping you understand build dependencies, document architecture, and debug complex multi-stage builds.\n\n## What You Get\n\nThe generated graph includes:\n\n**Nodes:**\n\n- All build stages\n- Default build target (highlighted in grey)\n- External images (with dashed borders)\n\n**Edges:**\n\n- `FROM ...` dependencies → solid line with full arrow\n- `COPY --from=...` dependencies → dashed line with empty arrow\n- `RUN --mount=(.*)from=...` dependencies → dotted line with diamond arrow\n\nSupports multiple output formats (PDF, SVG, PNG), a legend, and layout customization options.\n\n## Example Output\n\n### With Legend (`--legend`)\n\n![Example output including a legend](./examples/images/Dockerfile-legend.svg)\n\n### With Layer Visualization and Hidden Scratch Images (`--layers --scratch hidden`)\n\n![Example output including layers](./examples/images/Dockerfile-layers.svg)\n\n### Complex Multi-stage Build (`--concentrate --nodesep 0.3 --unflatten 4`)\n\n![Example output with `--concentrate` and `--unflatten 4`](./examples/images/Dockerfile-large.svg)\n\n## Getting Started\n\n### Prerequisites\n\n- A multi-stage [Dockerfile](https://docs.docker.com/engine/reference/builder/)\n\n### Installation and Usage\n\nRun `dockerfilegraph` in your project directory to generate a `Dockerfile.pdf` with your build graph.\n\n#### Docker\n\n- **Alpine-based** (Graphviz 12.2) - **Default**:\n\n  ```shell\n  docker run --rm --user \"$(id -u):$(id -g)\" \\\n    -v \"$(pwd)\":/workspace -w /workspace \\\n    ghcr.io/patrickhoefler/dockerfilegraph\n  ```\n\n- **Ubuntu-based** (Graphviz 2.42):\n\n  ```shell\n  docker run --rm --user \"$(id -u):$(id -g)\" \\\n    -v \"$(pwd)\":/workspace -w /workspace \\\n    ghcr.io/patrickhoefler/dockerfilegraph:ubuntu\n  ```\n\n#### Homebrew\n\n```shell\nbrew install patrickhoefler/tap/dockerfilegraph\ndockerfilegraph\n```\n\n#### [toolctl](https://github.com/toolctl/toolctl)\n\n*Requirements: [Graphviz](https://graphviz.org/) installed locally*\n\n```shell\ntoolctl install dockerfilegraph\ndockerfilegraph\n```\n\n#### Build from Source\n\n- **Native Build**\n\n  *Requirements: `make`, [Go](https://go.dev/) and [Graphviz](https://graphviz.org/)*\n\n  ```shell\n  make build\n  ./dockerfilegraph\n  ```\n\n- **Container Build (Alpine)**\n\n  *Requirements: `make`, [Go](https://go.dev/) and Docker*\n\n  ```shell\n  make build-docker-image-alpine\n  docker run \\\n    --rm \\\n    --user \"$(id -u):$(id -g)\" \\\n    --workdir /workspace \\\n    --volume \"$(pwd)\":/workspace \\\n    dockerfilegraph:alpine\n  ```\n\n- **Container Build (Ubuntu)**\n\n  *Requirements: `make`, [Go](https://go.dev/) and Docker*\n\n  ```shell\n  make build-docker-image-ubuntu\n  docker run \\\n    --rm \\\n    --user \"$(id -u):$(id -g)\" \\\n    --workdir /workspace \\\n    --volume \"$(pwd)\":/workspace \\\n    dockerfilegraph:ubuntu\n  ```\n\n## Configuration Options\n\n**Common Flags:**\n\n- `--output svg|png|pdf` - Choose your output format\n- `--legend` - Add a legend explaining the notation\n- `--layers` - Show all Docker layers\n\n**All Available Options:**\n\n```text\n❯ dockerfilegraph --help\ndockerfilegraph visualizes your multi-stage Dockerfile.\nIt creates a visual graph representation of the build process.\n\nUsage:\n  dockerfilegraph [flags]\n\nFlags:\n  -c, --concentrate             concentrate the edges (default false)\n  -d, --dpi uint                dots per inch of the PNG export (default 96)\n  -e, --edgestyle               style of the graph edges, one of: default, solid (default default)\n  -f, --filename string         name of the Dockerfile (default \"Dockerfile\")\n  -h, --help                    help for dockerfilegraph\n      --layers                  display all layers (default false)\n      --legend                  add a legend (default false)\n  -m, --max-label-length uint   maximum length of the node labels, must be at least 4 (default 20)\n  -n, --nodesep float           minimum space between two adjacent nodes in the same rank (default 1)\n  -o, --output                  output file format, one of: canon, dot, pdf, png, raw, svg (default pdf)\n  -r, --ranksep float           minimum separation between ranks (default 0.5)\n      --scratch                 how to handle scratch images, one of: collapsed, hidden, separated (default collapsed)\n  -u, --unflatten uint          stagger length of leaf edges between [1,u] (default 0)\n      --version                 display the version of dockerfilegraph\n```\n\n## Contributing\n\nFound a bug or have a feature request? [Open an issue](https://github.com/patrickhoefler/dockerfilegraph/issues) or submit a pull request.\n\n## License\n\n[MIT](https://github.com/patrickhoefler/dockerfilegraph/blob/main/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickhoefler%2Fdockerfilegraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrickhoefler%2Fdockerfilegraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrickhoefler%2Fdockerfilegraph/lists"}