diff --git a/pkg/util/tar_util.go b/pkg/util/tar_util.go index ba9dc8738..2dba6233c 100644 --- a/pkg/util/tar_util.go +++ b/pkg/util/tar_util.go @@ -92,6 +92,8 @@ func (t *Tar) AddFileToTar(p string) error { // this makes this layer unnecessarily differ from a cached layer which does contain this information hdr.Uname = "" hdr.Gname = "" + // use PAX format to preserve accurate mtime (match Docker behavior) + hdr.Format = tar.FormatPAX hardlink, linkDst := t.checkHardlink(p, i) if hardlink {