Skip to content

archive: add WithSourceDateEpoch() for whiteouts#7478

Merged
estesp merged 1 commit intocontainerd:mainfrom
AkihiroSuda:archive-whiteout-source-date-epoch
Oct 10, 2022
Merged

archive: add WithSourceDateEpoch() for whiteouts#7478
estesp merged 1 commit intocontainerd:mainfrom
AkihiroSuda:archive-whiteout-source-date-epoch

Conversation

@AkihiroSuda
Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda commented Oct 5, 2022

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.


Test:

# SOURCE_DATE_EPOCH=0 ctr snapshot diff sha256:ec34fcc1d526fba48f7f88e4ec765fccc17d4692570db85cf32d9d6b020330f2 sha256:04b69f878dd826fea9dadacf3d01c1e3dc0ebc95a577f4e3366fd55b175ad939  | tar tzv
drwxr-xr-x root/root         0 2022-10-08 08:41 etc/
-rwxr-xr-x root/root         0 2022-10-08 08:41 etc/resolv.conf
---------- 0/0               0 1970-01-01 09:00 etc/.wh.sysctl.conf
drwx------ root/root         0 2022-10-08 08:41 root/
-rw------- root/root        40 2022-10-08 08:41 root/.ash_history

@AkihiroSuda AkihiroSuda requested a review from tonistiigi October 5, 2022 08:15
@AkihiroSuda AkihiroSuda force-pushed the archive-whiteout-source-date-epoch branch 2 times, most recently from fad9ad8 to 11c93f3 Compare October 5, 2022 08:36
@AkihiroSuda AkihiroSuda marked this pull request as draft October 5, 2022 08:43
@AkihiroSuda AkihiroSuda force-pushed the archive-whiteout-source-date-epoch branch from 11c93f3 to ed2a542 Compare October 5, 2022 08:52
@AkihiroSuda AkihiroSuda marked this pull request as ready for review October 5, 2022 08:52
@AkihiroSuda AkihiroSuda force-pushed the archive-whiteout-source-date-epoch branch 4 times, most recently from ae32d24 to 1a4d77e Compare October 7, 2022 04:59
@AkihiroSuda AkihiroSuda force-pushed the archive-whiteout-source-date-epoch branch from 1a4d77e to 98a79cf Compare October 7, 2022 08:27
@AkihiroSuda AkihiroSuda marked this pull request as draft October 7, 2022 21:30
@AkihiroSuda AkihiroSuda force-pushed the archive-whiteout-source-date-epoch branch from 98a79cf to 9cb19b8 Compare October 7, 2022 23:35
@AkihiroSuda AkihiroSuda changed the title archive: use SOURCE_DATE_EPOCH for whiteout timestamps archive: add WithSourceDateEpoch() for whiteouts Oct 7, 2022
@AkihiroSuda AkihiroSuda marked this pull request as ready for review October 7, 2022 23:37
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>
Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants