{"id":16946096,"url":"https://github.com/lsegal/drmake","last_synced_at":"2026-05-18T01:06:59.778Z","repository":{"id":65987776,"uuid":"179623504","full_name":"lsegal/drmake","owner":"lsegal","description":"Makefile where all the targets execute in isolated Docker containers. Docker+Make = Doctor Make.","archived":false,"fork":false,"pushed_at":"2019-04-05T22:47:05.000Z","size":8,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-21T08:48:47.968Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/lsegal.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-04-05T05:20:41.000Z","updated_at":"2023-07-25T14:24:52.000Z","dependencies_parsed_at":"2023-03-10T23:26:52.046Z","dependency_job_id":null,"html_url":"https://github.com/lsegal/drmake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lsegal/drmake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsegal%2Fdrmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsegal%2Fdrmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsegal%2Fdrmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsegal%2Fdrmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lsegal","download_url":"https://codeload.github.com/lsegal/drmake/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lsegal%2Fdrmake/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33161411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-17T22:39:12.733Z","status":"ssl_error","status_checked_at":"2026-05-17T22:39:10.741Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2024-10-13T21:24:57.610Z","updated_at":"2026-05-18T01:06:59.753Z","avatar_url":"https://github.com/lsegal.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dr. Make\n\n_The \"Dr\" stands for Docker_\n\nDr. Make is a [Make][make]-like tool that builds general purpose targets by\nrunning commands inside isolated Docker containers, allowing you to (a) take\nadvantage of software from pre-built images without needing any build software\non your development machine and (b) gain full isolation in the state of a\nbuild, allowing you to create more reliable build tools that work the same\nregardless of the development machine they are run on.\n\n## Installing\n\nYou can install with Go:\n\n```sh\ngo install github.com/lsegal/drmake/cmd/drmake\n```\n\nOr download pre-built binaries provided in [Releases][releases].\n\n## Usage\n\nCreate a `Makefile.phd` that executes commands:\n\n```Dockerfile\nFROM alpine AS print_version\nLABEL Description=\"Prints the version that you give it\"\nENVARG VERSION\nCMD echo \"The version is: ${VERSION}\"\n\nFROM alpine AS say_hello USING print_version\nCMD echo \"Wasn't that a nice version or what?\"\n```\n\nThe above `Makefile.phd` defines 2 targets, `print_version` and `say_hello`.\nThe first accepts an argument `VERSION` which can be passed via:\n\n```sh\ndrmake print_version -a VERSION=1.2.3\n```\n\nThe second target, `say_hello`, will echo some stuff after `print_version`,\nits dependency, runs.\n\nYou can _list_ all targets by using `drmake -l`.\n\n## Makefile.phd Syntax\n\n`Makefile.phd`s (also known as Phdfiles, Drfiles, or Drakefiles) look a lot like\nDockerfile in that you define multiple `FROM` blocks each with the `AS name`\nsuffix to define \"targets\". These targets are what `drmake` will execute.\nThat said, Phdfiles also come with a few tiny differences:\n\n### `FROM image USING dependencies...`\n\nYou can add `USING a b c d` to the end of a `FROM` line to define target\ndependencies (the target would depend on targets a, b, c, d in that order).\n\nFor example:\n\n```Dockerfile\nFROM alpine AS install\nRUN apk add -U git\n\nFROM alpine AS clone USING install\nRUN git clone git://github.com/lsegal/drmake\n\nFROM golang:1-alpine AS test USING clone\nRUN go test .\n```\n\n### `FROM ./path/to/directory`\n\nYou can use `FROM ./path/to/dir` syntax to point to a relative directory\nthat contains a Dockerfile (point at the dir, not the Dockerfile).\n\n### `FROM #target`\n\nYou can use `FROM #target` to copy the Dockerfile instructions from another\ntarget:\n\n```Dockerfile\nFROM golang:1-alpine AS base\nENV GOPATH=/root/go\n\nFROM #base AS build_tools\nCMD go build ./tools\n\nFROM #base AS build_deps\nCMD go build ./deps\n```\n\n### `FROM \u0026target`\n\nThis syntax is shorthand for pulling Dockerfile instructions from a directory\nrelative to your workspace inside of `.drmake/targets/NAME`.\n\nIn other words, the following:\n\n```Dockerfile\nFROM \u0026build\n```\n\nIs short-hand for:\n\n```Dockerfile\nFROM ./.drmake/targets/build as build\n```\n\nNote that another benefit of using `\u0026target` syntax is that you may omit the\n`AS build` part of the statement. The target name for both of these lines will\nbe `build`.\n\n### `ENVARG ARGUMENT=VALUE`\n\nYou can use this syntax to quickly define a build argument that is defined\nas an environment variable for later commands. This is a shortcut for:\n\n```Dockerfile\nARG ARGUMENT=VALUE\nENV ARGUMENT=${ARGUMENT}\n```\n\n### `ARTIFACT src dst`\n\nYou can use this in any target to define an artifact file that should be copied\nout of the image back to the host volume, for example:\n\n```Dockerfile\nARTIFACT build/* build/\n```\n\nThe above line copies all files inside the `build` directory of the isolated\nvolume back to the host volume under a `build/` directory.\n\nYou can copy individual files or directories; semantics work similarly to\nrunning `cp -R` with the src and dst arguments.\n\n## TODO\n\n- [ ] Support targets sourced from other Git repos (`https://` \u0026 `git://`)\n- [ ] Support lookup paths for target directories via `DRMAKE_PATH` or `-I`.\n- [ ] Better parsing and error messages\n- [ ] Tests\n- [ ] Possibly a whole new syntax closer to [GitHub Actions][actions]?\n\n## Copyright \u0026 License\n\nDrMake is copyright © 2019 by Loren Segal and licensed under the MIT license.\n\n[make]: https://www.gnu.org/software/make/\n[releases]: https://github.com/lsegal/drmake/releases\n[actions]: https://developer.github.com/actions/managing-workflows/workflow-configuration-options/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsegal%2Fdrmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flsegal%2Fdrmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flsegal%2Fdrmake/lists"}