You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/build-repro.md
+4-12Lines changed: 4 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -71,20 +71,12 @@ Workaround:
71
71
# Workaround for https://github.com/moby/buildkit/issues/3180
72
72
ARG SOURCE_DATE_EPOCH
73
73
RUN find $( ls / | grep -E -v "^(dev|mnt|proc|sys)$" ) -newermt "@${SOURCE_DATE_EPOCH}" -writable -xdev | xargs touch --date="@${SOURCE_DATE_EPOCH}" --no-dereference
74
-
```
75
-
76
-
The `touch` command above is [not effective](https://github.com/moby/buildkit/issues/3309) for mount point directories.
77
-
A workaround is to create mount point directories below `/dev` (tmpfs) so that the mount points will not be included in the image layer.
78
-
79
-
### Timestamps of whiteouts
80
-
Currently, the `SOURCE_DATE_EPOCH` value is not used for the timestamps of "whiteouts" that are created on removing files.
81
74
82
-
Workaround:
83
-
```dockerfile
84
-
# Squash the entire stage for resetting the whiteout timestamps.
85
-
# Workaround for https://github.com/moby/buildkit/issues/3168
75
+
# Squashing is needed so that only files with the defined timestamp from the last layer are added to the image.
76
+
# This squashing also addresses non-reproducibility of whiteout timestamps (https://github.com/moby/buildkit/issues/3168) on BuildKit prior to v0.12.
86
77
FROM scratch
87
78
COPY --from=0 / /
88
79
```
89
80
90
-
The timestamps of the regular files in the original stage are maintained in the squashed stage, so you do not need to touch the files after this `COPY` instruction.
81
+
The `touch` command above is [not effective](https://github.com/moby/buildkit/issues/3309) for mount point directories.
82
+
A workaround is to create mount point directories below `/dev` (tmpfs) so that the mount points will not be included in the image layer.
0 commit comments