{
  "slug": "dockerfile-source-date-epoch-context-and-stage-values-cc3f7b4de5eb",
  "title": "Dockerfile SOURCE_DATE_EPOCH context and stage values",
  "tools": [
    "buildkit"
  ],
  "tags": [
    "agent"
  ],
  "introduced_at": "2026-05-13T13:16:11.000Z",
  "announced_at": "2026-05-13T13:16:11.000Z",
  "effective_at": null,
  "date_basis": "source-publication",
  "status": "unknown",
  "how": {
    "incantation": "When building with a remote context or a stage timestamp, define `ARG SOURCE_DATE_EPOCH=context` or `ARG SOURCE_DATE_EPOCH=<stage>` to set the build timestamp from that source. Context resolution uses the Git commit time or, for HTTP contexts, `Last-Modified` or the newest TAR entry mtime when the header is absent.",
    "examples": [
      "ARG SOURCE_DATE_EPOCH=context\nFROM alpine",
      "ARG SOURCE_DATE_EPOCH=<stage>\nFROM alpine"
    ],
    "gotchas": [
      "Version: dockerfile/1.24.0",
      "SOURCE_DATE_EPOCH=context: Special build-arg value: resolve the main build context to a numeric Unix timestamp. Git context uses commit time; HTTP context uses `Last-Modified` or, for an archive without that header, the newest archive entry mtime.",
      "SOURCE_DATE_EPOCH=<stage>: Special build-arg value that selects the timestamp associated with the named stage.",
      "Prerequisite: Dockerfile frontend supports `SOURCE_DATE_EPOCH` as a special build arg since BuildKit 0.11; minimal support is available on older BuildKit with Dockerfile 1.5 frontend.",
      "The context timestamp is a Git commit timestamp for Git commit builds.",
      "For remote URL builds, the timestamp comes from TAR archive file metadata or the URL's `Last-Modified` header.",
      "Docs conflict: Release note says remote URL timestamps may come from TAR file metadata or `Last-Modified`; versioned build-repro docs specify the newest archive entry mtime when `Last-Modified` is absent."
    ]
  },
  "why_it_matters": "Set reproducible build timestamps from a remote context or build stage.",
  "sources": [
    "https://github.com/moby/buildkit/releases/tag/dockerfile/1.24.0",
    "https://github.com/moby/buildkit/blob/dockerfile/1.24.0/docs/build-repro.md"
  ],
  "rank": 0.94036,
  "judge": {
    "publish": true,
    "judge_model": "codex-cli/gpt-6-luna+typesafe/jev-1.13.0",
    "prompt_version": "extract-v7+enrich-v2+judge-v2x3+jev-publish-v1"
  },
  "review_state": "approved",
  "provenance": {
    "run_id": "wave1b-20261016",
    "verdict_id": "wave1b-20261016:wave1b-20261016-7169f97f04f1904a-0:gate",
    "evidence_hash": "25e839dc4260b8ce5568f737f174347c71fc12eb7712ba3c3654c7991875db50"
  },
  "review": {
    "draft_hash": "f65d5763face0af81449ee758e2220692acfbe6ae39dcd703d95456e04b9f43e",
    "reviewer": "publication-gate",
    "reviewed_at": "2026-10-07T00:00:00.000Z",
    "decision": "wave1b-20261016:gate",
    "reason": "3 of 3 judge runs approved with p_yes >= 0.9 (mean 0.94 >= 0.9; 2 needed) and Jev gave 0.63 (>= 0.6 needed)."
  }
}
