{"id":13514086,"url":"https://github.com/haines/multidockerfile","last_synced_at":"2025-03-31T02:33:21.095Z","repository":{"id":36963321,"uuid":"340658067","full_name":"haines/multidockerfile","owner":"haines","description":"Split multi-stage Dockerfiles into multiple files","archived":true,"fork":false,"pushed_at":"2023-09-19T11:04:39.000Z","size":751,"stargazers_count":9,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-01T17:37:20.508Z","etag":null,"topics":["docker","dockerfile","multi-stage"],"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/haines.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-02-20T13:12:50.000Z","updated_at":"2024-01-17T18:42:11.000Z","dependencies_parsed_at":"2024-01-13T19:24:23.295Z","dependency_job_id":"e9639a74-3627-496a-8e14-ce57a6959c17","html_url":"https://github.com/haines/multidockerfile","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haines%2Fmultidockerfile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haines%2Fmultidockerfile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haines%2Fmultidockerfile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/haines%2Fmultidockerfile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/haines","download_url":"https://codeload.github.com/haines/multidockerfile/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246407401,"owners_count":20772126,"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":["docker","dockerfile","multi-stage"],"created_at":"2024-08-01T05:00:46.045Z","updated_at":"2025-03-31T02:33:17.301Z","avatar_url":"https://github.com/haines.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# `multidockerfile`\n\n`multidockerfile` is a command-line tool that allows you to split multi-stage Dockerfiles into multiple files.\n\n## Background\n\n[Multi-stage builds](https://docs.docker.com/develop/develop-images/multistage-build/) are a powerful way to optimize Dockerfiles, especially when combined with [`docker buildx bake`](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md) to build multiple images in parallel.\nHowever, Docker requires that all stages are defined in a single Dockerfile, which can become difficult to navigate as it grows.\n\nWith `multidockerfile`, you can split the Dockerfile up, and recombine it with `multidockerfile join` before building the images.\n\n`multidockerfile` parses the individual Dockerfiles looking for the `FROM` and `COPY --from` instructions that create dependencies between stages.\nThe combined Dockerfile is sorted so that stages with dependencies appear after the stages on which they depend.\n\n## Installation\n\n### From binary releases\n\nPre-built binaries are available for each [release](https://github.com/haines/multidockerfile/releases).\nYou can download the correct version for your operating system, make it executable with `chmod +x`, and either execute it directly or put it on your path.\n\nSHA-256 checksums and GPG signatures are available to verify integrity.\nMy GPG public key can be obtained from\n\n\u003cdetails\u003e\n  \u003csummary\u003eGitHub (\u003ca href=\"https://github.com/haines\"\u003e@haines\u003c/a\u003e)\u003c/summary\u003e\n\n  ```console\n  $ curl https://github.com/haines.gpg | gpg --import\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003eKeybase (\u003ca href=\"https://keybase.io/haines\"\u003ehaines\u003c/a\u003e)\u003c/summary\u003e\n\n  ```console\n  $ curl https://keybase.io/haines/pgp_keys.asc | gpg --import\n  ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n  \u003csummary\u003ekeys.openpgp.net (\u003ca href=\"https://keys.openpgp.org/search?q=andrew%40haines.org.nz\"\u003eandrew@haines.org.nz\u003c/a\u003e)\u003c/summary\u003e\n\n  ```console\n  $ gpg --keyserver keys.openpgp.org --recv-keys 6E225DD62262D98AAC77F9CDB16A6F178227A23E\n  ```\n\u003c/details\u003e\n\n### With Docker\n\nA Docker image is available for each release at [ghcr.io/haines/multidockerfile](https://ghcr.io/haines/multidockerfile).\n\n## Usage\n\n### `multidockerfile join \u003cinputs\u003e ...`\n\nJoin multiple Dockerfiles into a single multi-stage Dockerfile.\n\n#### Arguments\n\n| Name | Description |\n|-|-|\n| `\u003cinputs\u003e ...` | Paths to the Dockerfiles to be joined. |\n\n#### Options\n\n| Short | Long | Default | Description |\n|-|-|-|-|\n| `-o` | `--output` | `-` | Where to write the multi-stage Dockerfile (`-` for stdout). |\n\n#### Example\n\n```dockerfile\n# dockerfiles/one.dockerfile\n\nFROM alpine AS one\n```\n\n```dockerfile\n# dockerfiles/two.dockerfile\n\nFROM alpine AS two\n```\n\n```console\n$ multidockerfile join dockerfiles/*.dockerfile\nFROM alpine AS one\nFROM alpine AS two\n```\n\n### `multidockerfile version`\n\nShow the `multidockerfile` version information.\n\n#### Example\n\n```console\n$ multidockerfile version\n{\n  \"Version\": \"0.1.0-dev\",\n  \"GitCommit\": \"20586c3eb00aad3dde1ca63eb47dcb14ae6372d5\",\n  \"Built\": \"2021-02-26T21:22:04Z\",\n  \"GoVersion\": \"go1.16\",\n  \"OS\": \"darwin\",\n  \"Arch\": \"amd64\"\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaines%2Fmultidockerfile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhaines%2Fmultidockerfile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhaines%2Fmultidockerfile/lists"}