archive: add WithSourceDateEpoch() for whiteouts

This makes diff archives to be reproducible.

The value is expected to be passed from CLI applications via the $SOUCE_DATE_EPOCH env var.

See https://reproducible-builds.org/docs/source-date-epoch/
for the $SOURCE_DATE_EPOCH specification.

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2022-10-08 08:45:03 +09:00
parent 6fcfcf3a89
commit 70fbedc217
13 changed files with 390 additions and 104 deletions

View File

@@ -19,6 +19,7 @@ syntax = "proto3";
package containerd.services.diff.v1;
import "google/protobuf/any.proto";
import "google/protobuf/timestamp.proto";
import "github.com/containerd/containerd/api/types/mount.proto";
import "github.com/containerd/containerd/api/types/descriptor.proto";
@@ -72,6 +73,10 @@ message DiffRequest {
// Labels are the labels to apply to the generated content
// on content store commit.
map<string, string> labels = 5;
// SourceDateEpoch specifies the timestamp used for whiteouts to provide control for reproducibility.
// See also https://reproducible-builds.org/docs/source-date-epoch/ .
google.protobuf.Timestamp source_date_epoch = 6;
}
message DiffResponse {