Hey there! I am on the journey to discover binary reproducible image builds. As background: I am using the current TypesScript SDK with the dagger run command (no functions or modules). The current problem I am running in is that withExec calls are executed with the current wall clock time and execs like useradd or chmod would change files with the current wall clock. I have understood that the whole "repeatable builds"-movement has agreed on the environment variable SOURCE_DATE_EPOCH and it is supposed to be supported by buildkit (If I understood it correctly, It would inject it as "current time" to its execution steps, see https://github.com/moby/buildkit/blob/master/docs/build-repro.md#source_date_epoch). I am not wondering if dagger supports this as well and if the dagger-cli/sdk connect call would implicitly pass this environment variable from the build host to the implicitly created dagger-engine container.
Has someone else tried something similar or would have an idea on that topic? Thanks in advance
#Reproducible builds
1 messages · Page 1 of 1 (latest)
If I get it correctly, it somehow would require dagger to run its publish / export commands with rewrite-timestamp?
@glad hamlet Maybe you can give some helps on this one, I never tried something like that, did you?
I know of SOURCE_DATE_EPOCH but haven't used it myself, not sure if we get it for "free" from Buildkit or if we need to represent it in our API in some way (I'd guess the latter). What we do have is a WithTimestamps API for recursively changing file modification timestamps of a File or Directory after-the-fact. Not the same thing, but maybe it's useful today. (I use it in Bass for ensuring file/dir inputs always have a canonical timestamp: https://github.com/vito/bass/blob/6ad2902d4a9011a17efc03c92a45dea3cdb33abc/pkg/runtimes/dagger.go#L338-343)
cc @molten slate since this topic came up in passing before (related to what makes a function 'pure')
@red patio would you consider creating an issue, so that we can track this idea in a more persistent way? Since buildkit supports it, there should be a short-term path to supporting it also.
Thanks! Will do so.