dockerfile: add (ADD|COPY) --timestamp=<RFC3339Nano> - #2911
Conversation
`(ADD|COPY) --timestamp=<RFC3339Nano>` would be useful for more reproducible builds. e.g., ```dockerfile FROM busybox AS base RUN echo hello >/hello FROM scratch COPY --from=base --timestamp="2006-01-02T15:04:05Z" /hello /hello ``` Closes issue 2910 Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
e9f8e7d to
13e2d4c
Compare
|
@AkihiroSuda Do you have more use cases in mind than reproducible builds. I've been working on SOURCE_DATE_EPOCH support in master...tonistiigi:source-date-epoch . Eventually, if this is set it should set timestamps for all copies in Dockerfile automatically. Currently, it is a build arg but if we want it to be set in Dockerfile as well, then could be a build directive, |
|
Also, looks like there is a related bug in LLB layer that needs to be fixed as well for this #2884 |
SGTM if it applies to http and local source ops as well as to exporters |
|
I'd love to revisit this idea. I currently worked on making our builds reproducible and timestamps of files were a major issue. Unfortunately I can't use Fixes the problem only partially as we have a quite big monolithic Dockerfile (thanks to bake ❤️). And we mostly have 1-2 build steps in the final image were the timestamps matter. Now that I'm writing this I'm wondering whether applying |
(ADD|COPY) --timestamp=<RFC3339Nano>would be useful for more reproducible builds.e.g.,
Closes #2910