Support reproducible builds with SOURCE_DATE_EPOCH
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- docker, github-actions
- Bereich
- build-system, ci-cd
Rechercherichtung
Start with .github/workflows/build.yml, especially the output construction at the referenced v1.17.0 line 803, and inspect the corresponding bake.yml workflow and metadata-action inputs. Trace how workflow inputs reach the build step, image/local outputs, and metadata labels or annotations. Done means both workflows support the proposed epoch behavior, including commit, and builds use consistent timestamps for layers and created metadata.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
Problem
Docker's reproducible builds guide for GitHub Actions recommends setting SOURCE_DATE_EPOCH, for example to the commit time (git log -1 --pretty=%ct), on the build step. With the build reusable workflow, there's currently no way to get a reproducible image:
- No input sets
SOURCE_DATE_EPOCHfor the build step. Passing it throughbuild-argsworks for the image config and history timestamps, because BuildKit reads it as a build arg too. But the caller has to compute the commit time in a separate job, since the reusable workflow builds from the Git context without a checkout. - File timestamps inside the layers aren't rewritten. That needs
rewrite-timestamp=trueon the image exporter (BuildKit docs). The workflow builds the output string itself (build.yml#L803 at v1.17.0), so callers can't add it. - With
set-meta-labels/set-meta-annotations,org.opencontainers.image.createdgets the build time, because metadata-action uses the current date, even whenSOURCE_DATE_EPOCHis set.
So two builds of the same commit always end up with different layer and image digests.
Proposal
A source-date-epoch input for build.yml (and bake.yml) that:
- sets
SOURCE_DATE_EPOCHfor the build step; - adds
rewrite-timestamp=trueto theimage(andlocal) output; - uses the same time for the
org.opencontainers.image.createdlabel and annotation whenset-meta-labels/set-meta-annotationsare on.
It would help most if the input could also take the commit time directly, for example source-date-epoch: commit, since the workflow already knows which commit it builds and callers wouldn't need an extra job for it.
Alternatives considered
build-args: SOURCE_DATE_EPOCH=…plus overridingmeta-labels/meta-annotations: fixes the metadata timestamps, but not the layer contents, so the digests still differ.- Using
docker/build-push-actiondirectly: works, but gives up what the reusable workflow provides (distributed native builds, signed cache, signed provenance).
- Vorherrschende Sprache
- Keine Sprachdaten
- Sterne
- 87
- Forks
- 23
- Ø Merge
- 5 T. 47 Min.
- Gemergte PRs (30 T.)
- 17
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus docker/github-builder
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 52/100
docker/github-builder#251 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 68/100
docker/github-builder#209 ·
Maintainer antworten meist innerhalb von 1 Tag
-
kind/enhancement
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 65/100
docker/github-builder#207 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
kind/enhancement status/triage
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 25/100
docker/github-builder#203 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
status/triage
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
docker/github-builder#193 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
Alle Issues in docker/github-builder
Ähnliche Issues
-
follow-up main-defect wave-A
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
carrick-sh/carrick#249 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Fix Makefile build graph: add data-file prerequisites and missing .PHONY entries so make -j is safeOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
-
Use GHA setup gradle actionEvtl. vergeben @bric3 hat das heute übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 67/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Homebrew/homebrew-core#317477 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
chore ci
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Tollcraft/soroban-cost-linter#891 ·
Maintainer antworten meist innerhalb von 1 Tag