Support reproducible builds with SOURCE_DATE_EPOCH
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- docker, github-actions
- 領域
- build-system, ci-cd
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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).
- 主要言語
- 言語のデータがありません
- スター
- 87
- フォーク
- 23
- 平均マージ
- 5日 47分
- マージ済み PR(30日)
- 17
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
docker/github-builder のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 52/100
docker/github-builder#251 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
docker/github-builder#209 ·
メンテナーはふだん 1 日以内に返信
-
kind/enhancement
難易度 3/5 1〜2日 初心者へのやさしさ 65/100
docker/github-builder#207 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
kind/enhancement status/triage
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
docker/github-builder#203 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
status/triage
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
docker/github-builder#193 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
docker/github-builder の issue をすべて見る
似ている issue
-
needs-triage Platform(Default)
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
atlassian-labs/compiled#1960 ·
メンテナーはふだん 1 日以内に返信
-
Cached wheel reuse fails when the build and metadata fallback share an output directory対応中かも @harbinresearcher が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
pypa/pyproject-hooks#240 · コメント 1 件 ·
-
status: team-only type: dependency-upgrade
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
spring-projects/spring-boot#52143 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
メンテナーはふだん 2 日以内に返信