source: add git.mtime attr for commit-time mtimes by tonistiigi · Pull Request #6600 · moby/buildkit (original) (raw)
Add git.mtime=commit option that normalizes all file, symlink, and directory mtimes in a git snapshot to the resolved commit timestamp. This enables reproducible builds from git sources.
When SOURCE_DATE_EPOCH is set in the Dockerfile frontend, the git context automatically uses commit-time mtimes. The URL query parameter ?mtime=commit|checkout can override this.
New LLB attr (git.mtime) and capability (source.git.mtime) are registered as experimental. Cache keys include the mtime policy so that commit-time and checkout-time snapshots are distinct.
Signed-off-by: Tonis Tiigi tonistiigi@gmail.com