{"record":{"id":"e0b890ef385e88c6","repo":"oven-sh/bun","slug":"dockerfile-not-found-dockerfilepath","errorCode":null,"errorMessage":"Dockerfile not found: ${dockerfilePath}","messagePattern":"Dockerfile not found: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/machine.mjs","lineNumber":1491,"sourceCode":"    if (!existsSync(bootstrapPath)) {\n      throw new Error(`Script not found: ${bootstrapPath}`);\n    }\n    if (ci) {\n      const npx = which(\"bunx\") || which(\"npx\");\n      if (!npx) {\n        throw new Error(\"Executable not found: bunx or npx\");\n      }\n      const entryPath = resolve(import.meta.dirname, \"agent.mjs\");\n      const tmpPath = mkdtempSync(join(tmpdir(), \"agent-\"));\n      agentPath = join(tmpPath, \"agent.mjs\");\n      await spawnSafe($`${npx} esbuild ${entryPath} --bundle --platform=node --format=esm --outfile=${agentPath}`);\n    }\n\n    if (features?.includes(\"docker\")) {\n      dockerfilePath = resolve(import.meta.dirname, \"../.buildkite/Dockerfile\");\n\n      if (!existsSync(dockerfilePath)) {\n        throw new Error(`Dockerfile not found: ${dockerfilePath}`);\n      }\n    }\n  }\n\n  // Use Packer for Windows Azure image builds — it handles VM creation,\n  // bootstrap, sysprep, and gallery capture via WinRM (no Run Command hacks).\n  if (args[\"cloud\"] === \"azure\" && os === \"windows\" && (command === \"create-image\" || command === \"publish-image\")) {\n    await buildWindowsImageWithPacker({ os, arch, release, command, ci, agentPath, bootstrapPath });\n    return;\n  }\n\n  /** @type {Machine} */\n  const machine = await startGroup(\"Creating machine...\", async () => {\n    console.log(\"Creating machine:\");\n    console.table({\n      \"Operating System\": os,\n      \"Architecture\": arch,\n      \"Distribution\": distro ? `${distro} ${release}` : release,","sourceCodeStart":1473,"sourceCodeEnd":1509,"githubUrl":"https://github.com/oven-sh/bun/blob/8c5296ac459e8252d3cd702f3fbcbb0c249d95d5/scripts/machine.mjs#L1473-L1509","documentation":"When the requested features include 'docker', machine.mjs requires the repo's Dockerfile at ../.buildkite/Dockerfile (resolved relative to the script's own directory) and throws if it is missing. The absolute path is printed in the message.","triggerScenarios":"Requesting the docker feature in a checkout that lacks the .buildkite directory — sparse checkouts, moved script copies, or after the Dockerfile was renamed upstream while your branch predates it.","commonSituations":"Sparse CI checkout excluding .buildkite/; running a fork where the Dockerfile was deleted; branch drift after build infrastructure files moved.","solutions":["Check the path from the error message with `ls`","Restore it: `git restore .buildkite/Dockerfile` (or merge upstream if it moved)","Omit the docker feature if this run does not need a Docker-equipped machine"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import { existsSync } from \"node:fs\";\n\nconst dockerfilePath = new URL(\"../.buildkite/Dockerfile\", import.meta.url);\nif (features.includes(\"docker\") && !existsSync(dockerfilePath)) {\n  throw new Error(\"docker feature requested but .buildkite/Dockerfile is absent from this checkout\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep .buildkite/ unsparsed in checkouts used for docker-feature machine builds","If forking/relocating machine.mjs, update the ../.buildkite resolution along with the move"],"tags":["docker","filesystem","ci","buildkite"],"backgroundTag":null,"analyzedSha":"8c5296ac459e8252d3cd702f3fbcbb0c249d95d5","analyzedAt":"2026-08-16T08:01:58.794Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}