Support reproducible builds with SOURCE_DATE_EPOCH
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 52/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- docker, github-actions
- Lĩnh vực
- build-system, ci-cd
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Không có dữ liệu ngôn ngữ
- Star
- 87
- Fork
- 23
- Merge trung bình
- 5 ngày 47 phút
- Pull request đã merge (30 ngày)
- 17
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của docker/github-builder
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 52/100
docker/github-builder#251 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
docker/github-builder#209 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/enhancement
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 65/100
docker/github-builder#207 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/enhancement status/triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
docker/github-builder#203 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
status/triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
docker/github-builder#193 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của docker/github-builder
Issue tương tự
-
wanted: [email protected]Đang mởmodule wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
bazelbuild/bazel-central-registry#11070 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
FujiNetWIFI/fujinet-firmware#1932 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
WinReg update to v8.0.0Đang mởcategory:port-update
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Maintainer thường phản hồi trong vòng 3 ngày
-
ci dependencies
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
sipyourdrink-ltd/bernstein#6479 ·
Maintainer thường phản hồi trong vòng 1 ngày